?
Solved

whatsup gold powershell script

Posted on 2014-01-13
2
Medium Priority
?
1,463 Views
Last Modified: 2014-02-20
Hello,

Im using whatsup gold v16 , i am trying to make a active monitor via powershell that will run a command called sipsak from the command line, and if it returns "SIP ok" then the monitor is up, and if it reports back "SIP failure" then the monitor is down. here is the command running in powershell. i just dont know how to script it in whatsup gold. can someone help?

PS C:\> & "C:\sipsak-0.9.5.exe"  -s sip:1234567890@173.251.68.100 -N -D 1
SIP ok
PS C:\> & "C:\sipsak-0.9.5.exe"  -s sip:1234567890@173.251.68.2 -N -D 1
nothing received, select returned error
SIP failure
PS C:\>

i cant seem to find online how to do this, and i dont know powershell at all.

Thanks in advance,
Dave
0
Comment
Question by:WCGS_Operations
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 39792383
I don't have any clue about Active Scripting in WUG, but from the examples I've seen you need to use $Context to get and set values from/to WUG. So your script would look like this:
$result = C:\sipsak-0.9.5.exe -s sip:1234567890@173.251.68.100 -N -D 1
if ($result -eq "SIP ok") {
  $Context.SetResult(0,"SIP ok")
} else {
  $Context.SetResult(1, "SIP failure: $($result -join ""`n"")"
}

Open in new window

Store that into a .ps1 file, and provide that script with full path to the action for monitoring  in WUG.
0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question