[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nagios-users
Subject:    Re: [Nagios-users] Checking URL on windows-client using NSClient++
From:       "Frater, Greg J" <GJFRATER () bechtel ! com>
Date:       2009-06-30 17:22:21
Message-ID: 872CB0AEB377C240A112DD7C10B2592904B216D4 () wtps0171 ! amers ! ibechtel ! com
[Download RAW message or body]

--===============3127821787109055152==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C9F9A7.537D2902"

This is a multi-part message in MIME format.


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_name                    webpage 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_dvl557@hotmail.com [mailto:jvc_dvl557@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.

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16850" name=GENERATOR></HEAD>
<BODY id=MailContainerBody 
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0 
topMargin=0 name="Compose message area" CanvasTabStop="true">
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>Dennis, </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>Your almost there, you need to set your vbs script to 
output an exit code of 0-4&nbsp;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>).&nbsp; \
 Then setup the nsclient to run your script as a plug in check.&nbsp; To do that 
you will need to follow these basic steps.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>1. add the configuration to the nsc.ini file on each xp 
workstation you want to run this check on.&nbsp; It should look something like 
this:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>[NRPE Handlers]</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><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 face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>2. Setup check in Nagios </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>In your commands definition file:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>define command 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
command_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 webpage_check<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
command_line&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$USER1$/check_nrpe \
                
-H $HOSTADDRESS$ -t 60 -c webpage_check<BR>}</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>In your services definition file:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>define service 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 XPhost01, XPhost02<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check \
 web page on XP host<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
display_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;webpage \
 check<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 webpage_check<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 service-template<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.....</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT><FONT face=Arial color=#0000ff 
size=2><SPAN class=851000717-30062009>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=851000717-30062009>That 
should do it, and it uses your existing script (i.e. no rework).&nbsp; 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=851000717-30062009>Good 
luck, hope that helps,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009>-greg</DIV>
<DIV dir=ltr align=left><BR></DIV></SPAN></FONT>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=851000717-30062009></SPAN></FONT>&nbsp;</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><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>&nbsp;</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>&nbsp;</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>&nbsp;</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:&nbsp;"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>&nbsp;</DIV>
<DIV><FONT face=Calibri>Has anyone else tried something like this 
before?</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>I use NSClient++ and Nagios v3.0.6.</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>Kind Regards,</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>Dennis de Vries.</FONT></DIV></BODY></HTML>


[Attachment #4 (--===============3127821787109055152==)]
------------------------------------------------------------------------------


_______________________________________________
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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic