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
Solved

whatsup gold powershell script

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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