Solved

whatsup gold powershell script

Posted on 2014-01-13
2
1,373 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 69

Accepted Solution

by:
Qlemo earned 500 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

733 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