<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7100.18"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>Hi Greg,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Thank you very much for the detailed
explenation.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I discovered that I even didn't had NRPE installed, now
I do.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>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"</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>This is the vbs script I used and edited a bit with some
help of google (i'm not a vbs expert): <A
href="http://pastebin.com/f6e35c30b">http://pastebin.com/f6e35c30b</A></FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>When I run this vbs script via a batch file to debug
it's output :</FONT></DIV>
<DIV><FONT
face=Calibri>-------------------TEST.BAT-----------------</FONT></DIV>
<DIV><FONT face=Calibri>wscript check_website.vbs<BR>echo wscript returned
%errorlevel%</FONT></DIV>
<DIV><FONT
face=Calibri>------------------------------------------------</FONT></DIV>
<DIV><FONT face=Calibri>I get the result of 0 or 1 just like it should
be.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Do you, or anyone else, have any suggestions on how
to finetune this so that i can solve this issue?</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Thank you in advance.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Kind regards,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Dennis de Vries</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=GJFRATER@bechtel.com
href="mailto:GJFRATER@bechtel.com">Frater, Greg J</A> </DIV>
<DIV><B>Sent:</B> Tuesday, June 30, 2009 7:22 PM</DIV>
<DIV><B>To:</B> <A title=jvc_dvl557@hotmail.com
href="mailto:jvc_dvl557@hotmail.com">jvc_dvl557@hotmail.com</A> ; <A
title="mailto:nagios-users@lists.sourceforge.net
Druk op CTRL en klik als je de link wilt volgen"
href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</A>
</DIV>
<DIV><B>Subject:</B> RE: [Nagios-users] Checking URL on windows-client using
NSClient++</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>Dennis, </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>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
(<A
href="http://nagiosplug.sourceforge.net/developer-guidelines.html#PLUGOUTPUT">http://nagiosplug.sourceforge.net/developer-guidelines.html#PLUGOUTPUT</A>).
Then setup the nsclient to run your script as a plug in check. To do that
you will need to follow these basic steps.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>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:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>[NRPE Handlers]</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>webpage_check=c:\windows\system32\cscript.exe //nologo
"c:\program files\nsclient++\scripts\web_page_check.vbs"</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>2. Setup check in Nagios </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>In your commands definition file:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>define command
{<BR>
command_name
webpage_check<BR>
command_line $USER1$/check_nrpe
-H $HOSTADDRESS$ -t 60 -c webpage_check<BR>}</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>In your services definition file:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>define service
{<BR>
host_name
XPhost01, XPhost02<BR>
service_description check
web page on XP host<BR>
display_name webpage
check<BR>
check_command
webpage_check<BR>
use
service-template<BR>
.....</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT><FONT color=#0000ff size=2
face=Arial><SPAN
class=851000717-30062009>
}</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=851000717-30062009>That
should do it, and it uses your existing script (i.e. no rework).
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=851000717-30062009>Good
luck, hope that helps,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009>-greg</DIV>
<DIV dir=ltr align=left><BR></DIV></SPAN></FONT>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=851000717-30062009></SPAN></FONT> </DIV>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> jvc_dvl557@hotmail.com
[mailto:jvc_dvl557@hotmail.com] <BR><B>Sent:</B> Tuesday, June 30, 2009 4:08
AM<BR><B>To:</B> nagios-users@lists.sourceforge.net<BR><B>Subject:</B>
[Nagios-users] Checking URL on windows-client using
NSClient++<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Calibri>Hi,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>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. </FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I would like to check if the page is shown up and if
it's not, it notifies Nagios which notifies me by email.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>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.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Has anyone else tried something like this
before?</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I use NSClient++ and Nagios v3.0.6.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Kind Regards,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Dennis de Vries.</FONT></DIV></BODY></HTML>