<font size=2 face="sans-serif">Dear All,</font>
<br>
<br><font size=2 face="sans-serif">Does anyone have a way to run VBS External
scripts via Windows Schedule Tasks, and send the results directly back
to the Xymon Server?</font>
<br>
<br><font size=2 face="sans-serif">Martin.</font>
<br>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by Martin
Wojak/DSE/VICGOV1 on 30/04/2015 03:06 PM -----</font>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:      
 </font><font size=1 face="sans-serif">Brandon Dale <BDale@kitchengroup.com.au></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:      
 </font><font size=1 face="sans-serif">"martin.wojak@delwp.vic.gov.au"
<martin.wojak@delwp.vic.gov.au>, </font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:      
 </font><font size=1 face="sans-serif">"stef.coene@docum.org"
<stef.coene@docum.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">30/04/2015 01:44 PM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">RE: Xymon PS
Client and External VBS scripts</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 color=#004080 face="Calibri">Hey Martin,</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">I’m also just a sysadmin,
this is something I have wanted to do as well as there are some vbscripts
I could use as externals but haven’t worked out an easy way yet. I don’t
really know vbscript either which doesn’t help </font><font size=2 color=#004080 face="Wingdings">L</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">These are the options I can
think of:</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">1.       Use
bbwin just for these external tests.</font>
<br><font size=2 color=#004080 face="Calibri">2.       Use
Get-Content somehow in powershell to get the information you need from
the output of those scripts and send that to xymon using xymonsend</font>
<br><font size=2 color=#004080 face="Calibri">3.       I
“think” there is a way to run vbscript code inside powershell, you could
possibly put it inside a powershell script and send directly to xymon.</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">The last and ideal option
is rewrite them in powershell, I know there are some similar scripts already
out there but they would need to be modified to work with xymon. For example
</font><a href="https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542"><font size=2 color=blue face="Calibri"><u>https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542</u></font></a><font size=2 color=#004080 face="Calibri">
and there are some nagios scripts that do similar things. </font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">Option 1 is the easiest if
you don’t have the time to play around with PowerShell especially if you
already have bbwin on all those servers. You should be able to just disable
all the normal tests for the bbwin client by commenting out something in
the .cfg file and use it only to send these externals.</font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 color=#004080 face="Calibri">Regards, </font>
<br><font size=3 face="Calibri"> </font>
<br><font size=2 color=#0000a1 face="Tahoma"><b>Brandon Dale</b></font>
<br><font size=2 color=#0000a1 face="Tahoma"><b>Network Administrator</b></font>
<br><font size=3 color=#0000a1 face="Tahoma"><b> </b></font>
<br><font size=3 color=#0000a1 face="Arial"><b>Kitchen </b></font><font size=3 color=#808080 face="Arial"><b>|
Group</b></font>
<br><font size=3 color=#808080 face="Arial"><b> </b></font>
<br><font size=1 color=#808080 face="Tahoma"><b>1 Wella Way Somersby, NSW,
2250</b></font>
<br><font size=2 color=#0000a1 face="Tahoma">T </font><font size=1 color=#808080 face="Tahoma"><b>(02)
4343 6000</b></font><font size=2 color=#808080 face="Tahoma"><b> | </b></font><font size=2 color=#0000a1 face="Tahoma">D
</font><font size=1 color=#808080 face="Tahoma"><b>(02) 4343 6052</b></font><font size=2 color=#808080 face="Tahoma"><b>
| </b></font><font size=2 color=#0000a1 face="Tahoma">F </font><font size=1 color=#808080 face="Tahoma"><b>(02)
4343 6080</b></font>
<br><font size=2 color=#0000a1 face="Tahoma">E </font><a href=mailto:%20BDale@kitchengroup.com.au><font size=3 color=blue face="Times New Roman"><u>BDale@kitchengroup.com.au</u></font></a>
<br><img src=cid:_2_0C1E3B2C0C1E38C0001CC998CA257E37><font size=1 color=#3f8080 face="Comic Sans MS">please
consider the environment before printing this e-mail</font>
<div align=center>
<hr></div>
<br><font size=1 color=#004080 face="Calibri">Disclaimer: This communication
is confidential and intended only for the addressee. It may contain legally
privileged information. By the use of email over the Internet, Kitchen
Group is not waiving either confidentiality of, or legal privilege in,
the contents of this email and any attachments. If you are not the addressee
you may not use, disseminate or copy this information. If you have received
this information in error please notify us immediately. Whilst we have
taken all reasonable care to ensure that neither our system, this email
nor any attachments has a virus, it is impossible to guard against every
possible virus. We advise you to scan the email and any attachments with
your anti virus software prior to use. We do not accept liability for any
loss or damage which may arise from receipt of this email or any attachments.</font>
<div align=center>
<hr></div>
<br><font size=1 color=#004080 face="Calibri"> </font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=#004080 face="Calibri"> </font>
<br><font size=2 face="Tahoma"><b>From:</b> martin.wojak@delwp.vic.gov.au
[</font><a href=mailto:martin.wojak@delwp.vic.gov.au><font size=2 face="Tahoma">mailto:martin.wojak@delwp.vic.gov.au</font></a><font size=2 face="Tahoma">]
<b><br>
Sent:</b> Tuesday, 28 April 2015 4:02 PM<b><br>
To:</b> Brandon Dale<b><br>
Cc:</b> stef.coene@docum.org<b><br>
Subject:</b> Xymon PS Client and External VBS scripts</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 face="Arial">Hi Brandon,</font><font size=3 face="Times New Roman">
<br>
</font><font size=2 face="Arial"><br>
I'm trying to migrate our 300 VMs from bbwin to PS-client.  I love
some of the new functionality of the PS client, that bbwin doesn't have
(eg. dirtime, dirsize, restart failed service).  But I have 2 External
VBS scripts that I would like to keep using.</font><font size=3 face="Times New Roman">
<br>
</font><font size=2 face="Arial"><br>
I had a look at converting our 2 VBS scripts that are currently called
from BBwin, to be able to use xymonsend.ps1 (or some other way), to talk
directly to our Xymon server.   I couldn't work out how to do it.
 I'm just a SysAdmin, not a programmer or developer, so not very good
with VB or PS.</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="Arial"><br>
If you have time, and would be easy to do, can you work out how I can make
these 2 scripts operate as Windows Scheduled tasks and send data directly
to our Xymon server.</font><font size=3 face="Times New Roman"> <br>
<br>
</font><font size=2 face="Arial">Ta.</font><font size=3 face="Times New Roman">
<br>
</font><font size=2 face="Arial"><br>
Martin.</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 color=#2f2f2f face="Calibri"><b><br>
Martin Wojak | Senior Infrastructure Support Officer (Fire) |Information
Services Division </b></font><font size=2 color=#3f8080 face="Calibri"><b><br>
Corporate Services | </b>Department of Environment, Land, Water & Planning</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
Level 9, 8 Nicholson St, East Melbourne, Victoria 3002</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><b><br>
T</b>: 03 9637 8470 | <b>M</b>: 0421 445 529 | <b>E</b>: </font><a href=mailto:martin.wojak@delwp.vic.gov.au><font size=2 color=blue face="Calibri"><u>martin.wojak@delwp.vic.gov.au</u></font></a><font size=3 face="Times New Roman">
<br>
<br>
</font><font size=1 color=#800080 face="Arial">----- Forwarded by Martin
Wojak/DSE/VICGOV1 on 23/04/2015 02:00 PM -----</font><font size=3 face="Times New Roman">
<br>
</font><font size=1 color=#5f5f5f face="Arial"><br>
From:        </font><font size=1 face="Arial">Brandon
Dale <</font><a href=mailto:BDale@kitchengroup.com.au><font size=1 color=blue face="Arial"><u>BDale@kitchengroup.com.au</u></font></a><font size=1 face="Arial">></font><font size=3 face="Times New Roman">
</font><font size=1 color=#5f5f5f face="Arial"><br>
To:        </font><font size=1 face="Arial">Stef Coene
<</font><a href=mailto:stef.coene@docum.org><font size=1 color=blue face="Arial"><u>stef.coene@docum.org</u></font></a><font size=1 face="Arial">>,
"</font><a href=mailto:xymon@xymon.com><font size=1 color=blue face="Arial"><u>xymon@xymon.com</u></font></a><font size=1 face="Arial">"
<</font><a href=mailto:xymon@xymon.com><font size=1 color=blue face="Arial"><u>xymon@xymon.com</u></font></a><font size=1 face="Arial">>,
</font><font size=1 color=#5f5f5f face="Arial"><br>
Date:        </font><font size=1 face="Arial">08/04/2015
12:57 PM</font><font size=3 face="Times New Roman"> </font><font size=1 color=#5f5f5f face="Arial"><br>
Subject:        </font><font size=1 face="Arial">Re:
[Xymon] Xymon PS Client</font><font size=3 face="Times New Roman"> </font><font size=1 color=#5f5f5f face="Arial"><br>
Sent by:        </font><font size=1 face="Arial">"Xymon"
<</font><a href="mailto:xymon-bounces@xymon.com"><font size=1 color=blue face="Arial"><u>xymon-bounces@xymon.com</u></font></a><font size=1 face="Arial">></font><font size=3 face="Times New Roman">
</font>
<div align=center>
<hr noshade></div>
<br><font size=2 face="Calibri"><br>
Might be a better way but this is how I do it (my external scripts are
written in PowerShell however)</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
1. I put </font><a href=http://sourceforge.net/p/xymon/code/HEAD/tree/sandbox/WinPSClient/xymonsend.ps1><font size=2 color=blue face="Calibri"><u>http://sourceforge.net/p/xymon/code/HEAD/tree/sandbox/WinPSClient/xymonsend.ps1</u></font></a><font size=2 face="Calibri">
onto each server inside the same directory as the PowerShell client</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
2. I dot source this into my external scripts (which I normally store in
c:\xymon\ext to keep it simple) and use it to send the status messages
to xymon.</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
3. Run these as scheduled tasks in windows.</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
From the readme:</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
"Talking to the Xymon Server</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
===========================</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
The "xymonsend.ps1" script contains a PowerShell function "XymonSend"</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
that lets you communicate with the Xymon server in the same way that</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
the "bb" utility does on the Unix platforms. To use it, you must
<br>
"source" this into your PowerShell commandline window: At the
"PS"</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
prompt, enter</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
                PS C:\xymon>
. .\xymonsend.ps1</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
.."</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
Here's an example of how I use it -  pointless script to test if c:\windows
exists and send the result to xymon (but you get the idea). It will display
as the column “customtest” for the host “testserver01”</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
$date=get-date -format "ddd MMM dd HH':'mm':'ss zzz yyyy"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
$DELAY="+10m"</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
$xymonserver="xymon01"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
$machine="testserver01"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
$column="Customtest"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
#test logic</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
if(Test-Path c:\windows){</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
    $colour="green"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
    $msg="&green ALL OK!"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
    } else {</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
    $colour="red"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
    $msg="&red world is ending"</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
    }</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
#send to xymon server</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
. c:\xymon\xymonsend.ps1</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
xymonsend "status$delay $machine.$column $colour $date</font><font size=3 face="Times New Roman">
</font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
$msg</font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=1 face="Calibri"><br>
" "$xymonserver"</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
Then schedule that in windows to run however often you want, you need to
set the delay to a value longer than then the interval between each run
of your schedule task to avoid it going purple.</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
Regards, <br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
Brandon <br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
-----Original Message-----<br>
From: Xymon [</font><a href="mailto:xymon-bounces@xymon.com"><font size=2 color=blue face="Calibri"><u>mailto:xymon-bounces@xymon.com</u></font></a><font size=2 face="Calibri">]
On Behalf Of Stef Coene<br>
Sent: Tuesday, 7 April 2015 11:47 PM<br>
To: </font><a href=mailto:xymon@xymon.com><font size=2 color=blue face="Calibri"><u>xymon@xymon.com</u></font></a><font size=2 face="Calibri"><br>
Subject: [Xymon] Xymon PS Client</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
Hi,</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
We are using the Powershell client on new servers. But we are missing the
option to execute external scripts. Has anyone an updated version or written
a patch so you can execute external scripts with the Powershell cient?</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
And if not, how do you execute external scripts when using the Powershell
client?</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
Stef</font><font size=3 face="Times New Roman"> </font><font size=2 face="Calibri"><br>
_______________________________________________</font><font size=3 face="Times New Roman">
</font><font size=2 face="Calibri"><br>
Xymon mailing list</font><font size=3 face="Times New Roman"> </font><font size=3 color=blue face="Times New Roman"><u><br>
</u></font><a href=mailto:Xymon@xymon.com><font size=2 color=blue face="Calibri"><u>Xymon@xymon.com</u></font></a><font size=3 face="Times New Roman">
</font><font size=3 color=blue face="Times New Roman"><u><br>
</u></font><a href=http://lists.xymon.com/mailman/listinfo/xymon><font size=2 color=blue face="Calibri"><u>http://lists.xymon.com/mailman/listinfo/xymon</u></font></a><font size=2 face="Courier New">_______________________________________________<br>
Xymon mailing list</font><font size=2 color=blue face="Courier New"><u><br>
</u></font><a href=mailto:Xymon@xymon.com><font size=2 color=blue face="Courier New"><u>Xymon@xymon.com</u></font></a><font size=3 color=blue face="Times New Roman"><u><br>
</u></font><a href=http://lists.xymon.com/mailman/listinfo/xymon><font size=2 color=blue face="Courier New"><u>http://lists.xymon.com/mailman/listinfo/xymon</u></font></a>