[Xymon] Xymon PS Client and External VBS scripts

David Baldwin david.baldwin at ausport.gov.au
Fri May 1 01:56:43 CEST 2015


BBWIN and BBNT before that had a filesystem poller that periodically 
checked a directory for text files with the name "TEST." (i.e. filename 
with no extension) and would send those as a report for 
"<clientname>.TEST" and then delete the file - it wouldn't be hard to 
add that functionality to the PS client. When I was working on it 
initially I didn't have a test that ran that way so it wasn't on my 
feature list, but it is a compatibility/migration issue. There are a 
number of Windows tests that just run that way, some of which are BAT 
files or VBS scripts. Adding into those tests a status report send using 
XymonSend.ps1 would require a bit of work, but so would rewriting them 
in Powershell depending on what they do. Even so, the target folder to 
write the report would still need to be updated in the test, as well as 
setting it up to run as a scheduled task. It would be preferable to not 
be still running BBWIN just to run a scheduled external tests with its 
own client test disabled to send the status messages, but that would 
still work.

David.
>
> Hi
>
> The simplest way is to write your tests as Powershell scripts then use 
> XymonSend.ps1 from the Windows PS Client to send in the results.
>
> https://svn.code.sf.net/p/xymon/code/sandbox/WinPSClient/xymonsend.ps1
>
> Cheers
>
> Zak
>
> *From:*Xymon [mailto:xymon-bounces at xymon.com] *On Behalf Of 
> *martin.wojak at delwp.vic.gov.au
> *Sent:* 30 April 2015 06:14
> *To:* xymon at xymon.com
> *Subject:* [Xymon] Xymon PS Client and External VBS scripts
>
> Dear All,
>
> Does anyone have a way to run VBS External scripts via Windows 
> Schedule Tasks, and send the results directly back to the Xymon Server?
>
> Martin.
>
> ----- Forwarded by Martin Wojak/DSE/VICGOV1 on 30/04/2015 03:06 PM -----
>
> From: Brandon Dale <BDale at kitchengroup.com.au 
> <mailto:BDale at kitchengroup.com.au>>
> To: "martin.wojak at delwp.vic.gov.au 
> <mailto:martin.wojak at delwp.vic.gov.au>" <martin.wojak at delwp.vic.gov.au 
> <mailto:martin.wojak at delwp.vic.gov.au>>,
> Cc: "stef.coene at docum.org <mailto:stef.coene at docum.org>" 
> <stef.coene at docum.org <mailto:stef.coene at docum.org>>
> Date: 30/04/2015 01:44 PM
> Subject: RE: Xymon PS Client and External VBS scripts
>
> ------------------------------------------------------------------------
>
>
>
>
> Hey Martin,
>
> 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 ☹
>
> These are the options I can think of:
>
> 1.       Use bbwin just for these external tests.
> 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
> 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.
>
> 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 
> https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542and 
> there are some nagios scripts that do similar things.
>
> 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.
>
> Regards,
>
> *Brandon Dale*
> *Network Administrator*
> **
> *Kitchen **| Group*
> **
> *1 Wella Way Somersby, NSW, 2250*
> T *(02) 4343 6000**| *D *(02) 4343 6052**| *F *(02) 4343 6080*
> E BDale at kitchengroup.com.au <mailto:%20BDale at kitchengroup.com.au>
> please consider the environment before printing this e-mail
>
> ------------------------------------------------------------------------
>
>
> 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.
>
> ------------------------------------------------------------------------
>
>
>
>
>
> *From:*martin.wojak at delwp.vic.gov.au 
> <mailto:martin.wojak at delwp.vic.gov.au> 
> [mailto:martin.wojak at delwp.vic.gov.au] *
> Sent:* Tuesday, 28 April 2015 4:02 PM*
> To:* Brandon Dale*
> Cc:* stef.coene at docum.org <mailto:stef.coene at docum.org>*
> Subject:* Xymon PS Client and External VBS scripts
>
> Hi Brandon,
>
> 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.
>
> 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.
>
> 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.
>
> Ta.
>
> Martin.
> *
> Martin Wojak | Senior Infrastructure Support Officer (Fire) 
> |Information Services Division **
> Corporate Services | *Department of Environment, Land, Water & Planning
> Level 9, 8 Nicholson St, East Melbourne, Victoria 3002 *
> T*: 03 9637 8470 | *M*: 0421 445 529 | *E*: 
> martin.wojak at delwp.vic.gov.au <mailto:martin.wojak at delwp.vic.gov.au>
>
> ----- Forwarded by Martin Wojak/DSE/VICGOV1 on 23/04/2015 02:00 PM -----
>
> From: Brandon Dale <BDale at kitchengroup.com.au 
> <mailto:BDale at kitchengroup.com.au>>
> To: Stef Coene <stef.coene at docum.org <mailto:stef.coene at docum.org>>, 
> "xymon at xymon.com <mailto:xymon at xymon.com>" <xymon at xymon.com 
> <mailto:xymon at xymon.com>>,
> Date: 08/04/2015 12:57 PM
> Subject: Re: [Xymon] Xymon PS Client
> Sent by: "Xymon" <xymon-bounces at xymon.com 
> <mailto:xymon-bounces at xymon.com>>
>
> ------------------------------------------------------------------------
>
>
>
> Might be a better way but this is how I do it (my external scripts are 
> written in PowerShell however)
>
> 1. I put 
> http://sourceforge.net/p/xymon/code/HEAD/tree/sandbox/WinPSClient/xymonsend.ps1onto 
> each server inside the same directory as the PowerShell client
> 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.
> 3. Run these as scheduled tasks in windows.
>
> From the readme:
>
> "Talking to the Xymon Server
> ===========================
> The "xymonsend.ps1" script contains a PowerShell function "XymonSend"
> that lets you communicate with the Xymon server in the same way that
> the "bb" utility does on the Unix platforms. To use it, you must
> "source" this into your PowerShell commandline window: At the "PS"
> prompt, enter
>
>                PS C:\xymon> . .\xymonsend.ps1
> .."
>
> 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”
>
>
> $date=get-date -format "ddd MMM dd HH':'mm':'ss zzz yyyy"
> $DELAY="+10m"
> $xymonserver="xymon01"
> $machine="testserver01"
> $column="Customtest"
>
> #test logic
> if(Test-Path c:\windows){
>    $colour="green"
>    $msg="&green ALL OK!"
>    } else {
>    $colour="red"
>    $msg="&red world is ending"
>    }
>
> #send to xymon server
> . c:\xymon\xymonsend.ps1
>
> xymonsend "status$delay $machine.$column $colour $date
>
> $msg
>
>
> " "$xymonserver"
>
> 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.
>
> Regards,
>
>
> Brandon
>
>
> -----Original Message-----
> From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Stef Coene
> Sent: Tuesday, 7 April 2015 11:47 PM
> To: xymon at xymon.com <mailto:xymon at xymon.com>
> Subject: [Xymon] Xymon PS Client
>
> Hi,
>
> 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?
>
> And if not, how do you execute external scripts when using the 
> Powershell client?
>
>
> Stef
> _______________________________________________
> Xymon mailing list _
> _Xymon at xymon.com <mailto:Xymon at xymon.com> _
> _http://lists.xymon.com/mailman/listinfo/xymon_______________________________________________
> Xymon mailing list_
> _Xymon at xymon.com <mailto:Xymon at xymon.com>_
> _http://lists.xymon.com/mailman/listinfo/xymon
>
>
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon


-- 
David Baldwin - Senior Systems Administrator (Datacentres + Networks)
Information and Communication Technology Services
Australian Sports Commission          http://ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
david.baldwin at ausport.gov.au          1 Leverrier Street Bruce ACT 2617
Our Values: RESPECT + INTEGRITY + TEAMWORK + EXCELLENCE


-------------------------------------------------------------------------------------
Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
-------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150501/4674f470/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1161 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150501/4674f470/attachment.jpe>


More information about the Xymon mailing list