Page 1 of 1
DFSR.vbs
Posted: Thu Apr 07, 2016 9:31 am
by bladezz
I have been trying to get this script running top check our DFS using nrpe following the instructions from
https://exchange.nagios.org/directory/A ... og/details nrpe is listening on port 5666 locally on the windows server I run the script using the command cscript.exe C:\nrpe_nt.0.8b-bin\bin\DFSR.vbs I get 927,10 Microsoft VBScript runtime error :subscript out of range. If anyone can help as I'm not a coder and have very little knowledge of Nagios. If I try the command(check_nrpe -u -H server ip -c check_DFSR -t 180 -a 600) from the Nagios server I get No handler for that command. Can someone help with a dummies step by step guide on how to get this working. It would be good to be able to monitor DFS I am using windows server 2008 r2. If I run check_nrpe -H ip address of the host it says everything is looking fine so Nagios can talk to the server.
Re: DFSR.vbs
Posted: Thu Apr 07, 2016 12:20 pm
by gormank
The vbscript error is a vbscript problem not related to nagios.
The NRPE error means the comman isn't defined. You tell NRPE to run commands, which are defined in an cfg/ini file. The cfg/ini file tells NRPE what script/binary to run. For NRPE on linux, its typically nrpe.cfg, and on windows nsclient.ini.
Re: DFSR.vbs
Posted: Thu Apr 07, 2016 2:49 pm
by rkennedy
I do see this part in the attached configuration, however I don't think it's under the right part.
Code: Select all
[/settings/external scripts/scripts]
check_DFSR = cscript.exe //NoLogo C:\nrpe_nt.0.8b-bin\bin\DFSR.vbs $ARG1$
check_DFSBacklog = cscript.exe //NoLogo C:\nrpe_nt.0.8b-bin\bin\DFS-Backlog.vbs $ARG1$
Just to clarify - are you using NRPE_NT or NSClient++? Your config file is for one, but it looks like you're referencing another in your testing. The testing will probably need arguments as well and not just a run of the .vbs plugin.
Re: DFSR.vbs
Posted: Fri Apr 08, 2016 2:11 am
by bladezz
Hi,
Thanks for the quick responses I would prefer to just use nsclient++ if possible but not sure how to configure it here is an example of the commands from the writer of the script
Nagios service:
$USER1$/check_nrpe -u -H $HOSTADDRESS$ -p 5666 -c check_DFSR -t 180 -a $ARG1$
COMMAND: /usr/local/nagios/libexec/check_nrpe -u -H SERVERNAME -p 5667 -c check_DFSR -t 180 -a 600
OUTPUT: 14 Replication groups passed, all under 600MB synch difference.
$USER1$/check_nrpe -u -H $HOSTADDRESS$ -t 420 -p 5667 -c check_DFSBacklog -a $ARG1$ $ARG2$ $ARG3$
COMMAND: /usr/local/nagios/libexec/check_nrpe -u -H SERVERNAME -t 420 -p 5667 -c check_DFSBacklog -a FOLDERNAME 100 200
OUTPUT: OK - 0 -BackLog Count for FOLDERNAME 0 -BackLog Count for FOLDERNAME
NRPE:
dont_blame_nrpe=1
command[check_DFSR]=cscript.exe //NoLogo C:nrpe_nt.0.8b-binbinDFSR.vbs $ARG1$
command[check_DFSBacklog]=cscript.exe //NoLogo C:nrpe_nt.0.8b-binbinDFS-Backlog.vbs $ARG1$
NSClient:
[/settings/NRPE/server]
allow arguments=1
[/settings/external scripts/scripts]
check_DFSR = cscript.exe //NoLogo C:nrpe_nt.0.8b-bin\bin\DFSR.vbs $ARG1$
check_DFSBacklog = cscript.exe //NoLogo C:nrpe_nt.0.8b-bin\bin\DFS-Backlog.vbs $ARG1$
if I run the command from the Nagios server as so ./check_nrpe -u -H SERVERNAME -p 5667 -c check_DFSR -t 180 -a 600 I get no handler for that command
if I run from the windows server cscript.exe //NoLogo C:nrpe_nt.0.8b-bin\bin\DFSR.vbs $ARG1$ I get the original script error I logged
Re: DFSR.vbs
Posted: Fri Apr 08, 2016 3:15 am
by bladezz
Hi All,
Thanks for your help on this I have now got it working when running the command from Nagios server ./check_nrpe -H ip address of host -c check_DFSR -t 180 -a 600 I had to move the nsclient commands in the ini file to the external scripts section. I now need to find away of getting this displayed in Nagios.
Re: DFSR.vbs
Posted: Fri Apr 08, 2016 10:17 am
by rkennedy
You'll want to create a service in the core configuration manager, and assign it the check command 'check_nrpe'. Also, make sure to assign it to a host and fill in the required fields.
From there, configure your $ARG#$ value's to line up according to how check_nrpe is defined. Here's an example -
check-nrpe.PNG
Re: DFSR.vbs
Posted: Fri Apr 08, 2016 1:31 pm
by bladezz
Thanks for all your help its up and running

Re: DFSR.vbs
Posted: Fri Apr 08, 2016 1:34 pm
by hsmith
Glad to hear it, I'll go ahead and close this post.