[xymon] XymonPSClient 64/32 bit and service runner issues
Storer, Raymond
storerr at nibco.com
Fri Oct 29 15:06:08 CEST 2010
Neil, color me interested too!
Thanks.
Ray
-----Original Message-----
From: Neil Franken [mailto:nfranken at theunlimited.co.za]
Sent: Friday, October 29, 2010 3:24 AM
To: xymon at xymon.com
Subject: RE: [xymon] XymonPSClient 64/32 bit and service runner issues
Hi David
The current project uses the first version of the xymon client ps script so it relies on the script finishing at some point. I don’t think it is a major train smash to make it execute it once and then let it run. I will check into that...
Regards
Neil
-----Original Message-----
From: David Baldwin [mailto:david.baldwin at ausport.gov.au]
Sent: 29 October 2010 09:09 AM
To: Neil Franken
Cc: xymon at xymon.com
Subject: Re: [xymon] XymonPSClient 64/32 bit and service runner issues
Neil,
> Hi David
>
> I worked on a .Net service which runs any powershell scripts as jobs. It uses the Qaurtz.Net scheduling component. Currently it works very similar to BBWin in that you dump the file to a directory and it picks it up. You can specify additional PS files with scheduling information in a config.xml file. The service is dynamically configurable with changes to the config being picked up in a matter of seconds and the service reloading on the fly. It also allows you to report to more than one Xymon server. I was trying to replace the BBWin client and the vapourware XyWin.net client.
>
>
The above sounds ideal. I was kind of hoping you might respond with
details of how far you'd gotten.
The main powershell client code doesn't exit, although if it did it
would be good for the service runner to either restart it if it did or
just die itself so that the Windows service restart options can come
into play.
> Anyway when you guys started working on the PS client I sort of stopped working on it. It is called XyWinMon and there is a project on sourceforge with the code. The idea was to have it execute VBS,JS,CMD and Powershell scripts as well as being able to use ADO.Net to login to Databases and execute queries if need be. Anyway long story short. It requires a script that will output to a file. You specify the information in the xml configuration file. Here is a example:
>
>
I started looking at running externals today, and it was all going to
end up in .Net Processes anyway - the powershell "start-job" stuff is
pretty limited. The scheduler you describe sounds just what is needed.
Definitely interested!
Thanks, David.
> <?xml version="1.0" encoding="utf-8" ?>
> <XyMon>
> <Client>
> <hostname>PRMW0154</hostname>
> <hostclass>bbwin win32</hostclass>
>
> </Client>
> <Server>
> <ip>172.27.14.199</ip>
> <port>1984</port>
> </Server>
>
>
> <Monitor>
> <scriptname>xymonclient2.ps1</scriptname>
> <timerinterval>360</timerinterval>
> <scripttype>powershell</scripttype>
> <outputfile>C:\ServiceTest\xymon.txt</outputfile>
> </Monitor>
> <Monitor>
> <scriptname>SQLServerJobsCheck.ps1</scriptname>
> <timerinterval>20</timerinterval>
> <scripttype>powershell</scripttype>
> <outputfile>c:\servicetest\sqljobs</outputfile>
> </Monitor>
>
> </XyMon>
>
> Anyway the script is run the output captured converted to unix style and sent to the xymon servers listed above. Like I said you can configure it dynamically. If the server is not there the service keeps on running and just logs a error.
>
> Anyway let me know if you are keen.
>
> Regards
> Neil
> -----Original Message-----
> From: David Baldwin [mailto:david.baldwin at ausport.gov.au]
> Sent: 29 October 2010 02:48 AM
> To: [xymon-developer]; xymon at xymon.com
> Subject: [xymon] XymonPSClient 64/32 bit and service runner issues
>
> All,
>
> The Xymon powershell client is coming along, but I've run into some
> annoying issues which are little to do with powershell itself and was
> seeking some advice if anyone is more familiar with options available
> for Windows for running services and 32/64 bit environments.
>
> I was just testing on a 64-bit 2008 server, installed service from an
> interactive shell, created a reg key with servers list I want to use
> then started service. Problem was, it didn't find the reg keys. Turned
> out that XYMONPSCLIENT.EXE (ABC-SRVANY.EXE) is running in 32-bit mode,
> and despite the PDF doc suggesting it can run 64-bit apps, and that the
> explicit path for powershell.exe appears to be the 64-bit version, it
> started as 32-bit and couldn't find the reg key because it could only
> see HKLM:\SOFTWARE as the HKLM:\SOFTWARE\WOW6432NODE subtree.
>
> I could put in logic to detect that and explicitly use WOW6432NODE even
> in 64-bit mode, but there's no reason to be running in 32-bit mode when
> it should be possible to run 64-bit when running as a service. I also
> have an issue with ABC-SRVANY.EXE, that if the child powershell process
> dies for whatever reason, the service process is still running but it
> doesn't seem to care, doesn't try to restart, doesn't exit (which would
> allow Windows service restart options to take effect), just sits there!
>
> Does anyone have any suggestions? If someone is able to write a basic
> (.Net-based?) .EXE service runner that just calls a powershell script
> and runs in 64-bit mode if it can, 32-bit otherwise that would seem
> ideal. All it would need to do is start the child process, handle
> service stop/start signals and manage the child process, and exit if the
> child dies. Doesn't sound hard, but I have no development environment
> for that available so don't really know where to start.
>
> Thanks, David.
>
>
--
David Baldwin - IT Unit
Australian Sports Commission www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616
david.baldwin at ausport.gov.au Leverrier Street Bruce ACT 2617
-------------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------------
To unsubscribe from the xymon list, send an e-mail to
xymon-unsubscribe at xymon.com
CONFIDENTIALITY NOTICE: This email and any attachments are for the
exclusive and confidential use of the intended recipient. If you are not
the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.
More information about the Xymon
mailing list