Re: [Nagios-users] Checking URL on windows-client using NSClient++
On Tue, Jul 14, 2009 at 5:42 AM, jvc_dvl...@hotmail.com wrote: Hi Patrick, I do get a result/output when I run the batch as described (0 or 1). But I read that it needs to output in STDOUT format and I don't know how to write that in vbs... All tips are welcome. http://www.codeguru.com/forum/archive/index.php/t-243393.html 1) use cscript.exe for command-line scripts 2) WScript.StdOut.Write(Hi There) - Max -- Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Checking URL on windows-client using NSClient++
On Tue, 14 Jul 2009, jvc_dvl...@hotmail.com wrote: Hi Patrick, I do get a result/output when I run the batch as described (0 or 1). But I read that it needs to output in STDOUT format and I don't know how to write that in vbs... All tips are welcome. A result code and output are not the same thing. -- Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Checking URL on windows-client using NSClient++
Hi jvc_dvl557! On Wed, 01 Jul 2009, jvc_dvl...@hotmail.com wrote: Hi Greg, Thank you very much for the detailed explenation. I discovered that I even didn't had NRPE installed, now I do. I got everything running, except for the exit/output code. Nagios runs the script on the client host perfectly but it gives me an error saying: No output available from command (c:\windows\system32\cscript.exe //nologo c:\nsclient\scripts\check_website.vbs This is the vbs script I used and edited a bit with some help of google (i'm not a vbs expert): http://pastebin.com/f6e35c30b When I run this vbs script via a batch file to debug it's output : ---TEST.BAT- wscript check_website.vbs echo wscript returned %errorlevel% I get the result of 0 or 1 just like it should be. Do you, or anyone else, have any suggestions on how to finetune this so that i can solve this issue? Can you modify check_website.vbs so it *does* return a line of output? -- Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Checking URL on windows-client using NSClient++
Hi Greg, Thank you very much for the detailed explenation. I discovered that I even didn't had NRPE installed, now I do. I got everything running, except for the exit/output code. Nagios runs the script on the client host perfectly but it gives me an error saying: No output available from command (c:\windows\system32\cscript.exe //nologo c:\nsclient\scripts\check_website.vbs This is the vbs script I used and edited a bit with some help of google (i'm not a vbs expert): http://pastebin.com/f6e35c30b When I run this vbs script via a batch file to debug it's output : ---TEST.BAT- wscript check_website.vbs echo wscript returned %errorlevel% I get the result of 0 or 1 just like it should be. Do you, or anyone else, have any suggestions on how to finetune this so that i can solve this issue? Thank you in advance. Kind regards, Dennis de Vries From: Frater, Greg J Sent: Tuesday, June 30, 2009 7:22 PM To: jvc_dvl...@hotmail.com ; nagios-users@lists.sourceforge.net Subject: RE: [Nagios-users] Checking URL on windows-client using NSClient++ Dennis, Your almost there, you need to set your vbs script to output an exit code of 0-4 according to the nagios plug in documentation (http://nagiosplug.sourceforge.net/developer-guidelines.html#PLUGOUTPUT). Then setup the nsclient to run your script as a plug in check. To do that you will need to follow these basic steps. 1. add the configuration to the nsc.ini file on each xp workstation you want to run this check on. It should look something like this: [NRPE Handlers] webpage_check=c:\windows\system32\cscript.exe //nologo c:\program files\nsclient++\scripts\web_page_check.vbs 2. Setup check in Nagios In your commands definition file: define command { command_name webpage_check command_line$USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c webpage_check } In your services definition file: define service { host_name XPhost01, XPhost02 service_description check web page on XP host display_namewebpage check check_command webpage_check use service-template . } That should do it, and it uses your existing script (i.e. no rework). Good luck, hope that helps, -greg From: jvc_dvl...@hotmail.com [mailto:jvc_dvl...@hotmail.com] Sent: Tuesday, June 30, 2009 4:08 AM To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Checking URL on windows-client using NSClient++ Hi, I would like to check if a certain website is available on some of my windows xp clients. These clients are public self-service computers to make bookings for a railway organisation. Every now and then, some of these self-service computers show a blank screen without the default start-page. I would like to check if the page is shown up and if it's not, it notifies Nagios which notifies me by email. I've tried to run an external script (vbs) which checks the availability of the site and that goes well if you use it manually but i dont want any popups saying: OK. It should run in the background. So i've edited the vbs file and now it does check it and doesnt give any output anymore. Has anyone else tried something like this before? I use NSClient++ and Nagios v3.0.6. Kind Regards, Dennis de Vries.-- ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Checking URL on windows-client using NSClient++
hi, if you use internet explorer you could check if that process is running. You can do it in a number of ways, either with check_nt or with nrpe with a custom batch file with commands like tasklist, for instance. -- Groeten, J.Asenjo -- ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Checking URL on windows-client using NSClient++
Dennis, Your almost there, you need to set your vbs script to output an exit code of 0-4 according to the nagios plug in documentation (http://nagiosplug.sourceforge.net/developer-guidelines.html#PLUGOUTPUT) . Then setup the nsclient to run your script as a plug in check. To do that you will need to follow these basic steps. 1. add the configuration to the nsc.ini file on each xp workstation you want to run this check on. It should look something like this: [NRPE Handlers] webpage_check=c:\windows\system32\cscript.exe //nologo c:\program files\nsclient++\scripts\web_page_check.vbs 2. Setup check in Nagios In your commands definition file: define command { command_name webpage_check command_line$USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c webpage_check } In your services definition file: define service { host_name XPhost01, XPhost02 service_description check web page on XP host display_namewebpage check check_command webpage_check use service-template . } That should do it, and it uses your existing script (i.e. no rework). Good luck, hope that helps, -greg From: jvc_dvl...@hotmail.com [mailto:jvc_dvl...@hotmail.com] Sent: Tuesday, June 30, 2009 4:08 AM To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Checking URL on windows-client using NSClient++ Hi, I would like to check if a certain website is available on some of my windows xp clients. These clients are public self-service computers to make bookings for a railway organisation. Every now and then, some of these self-service computers show a blank screen without the default start-page. I would like to check if the page is shown up and if it's not, it notifies Nagios which notifies me by email. I've tried to run an external script (vbs) which checks the availability of the site and that goes well if you use it manually but i dont want any popups saying: OK. It should run in the background. So i've edited the vbs file and now it does check it and doesnt give any output anymore. Has anyone else tried something like this before? I use NSClient++ and Nagios v3.0.6. Kind Regards, Dennis de Vries. -- ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null