I'm hoping someone can help me with this. I found this script on the nagios exchange (http://exchange.nagios.org/directory/Pl ... ck/details) and it works great when I run the vbscript locally on the client.
I would like to run this as a service check ($USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_ad $ARG1$).
I added the following line to nsclient.ini under the /settings/external scripts/scripts section: check_ad=cscript scripts\check_ad.vbs //nologo /test:$ARG1$
On the client the command that should run is: cscript check_ad.vbs //nologo /test:replications. Again, this works fine if I run locally from the client cmd prompt. When I run a test from the service screen this is what I get:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H IPADDRESS -t 30 -c check_ad replications
OUTPUT: CRITICAL - $ARG1$: CRITICAL.
I have a feeling I'm missing something in the nsclient.ini file, but I'm not sure what. All the documentation I find online refers to a nsc.ini file which I don't have.
Thanks!
Ryan
Vbscript Help
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Vbscript Help
try
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H IPADDRESS -t 30 -c check_ad -a "replications"-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Re: Vbscript Help
Didn't work, got the same response back:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.42.1.2 -t 30 -c check_ad -a "replications"
OUTPUT: CRITICAL - $ARG1$: CRITICAL.
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.42.1.2 -t 30 -c check_ad -a "replications"
OUTPUT: CRITICAL - $ARG1$: CRITICAL.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Vbscript Help
In the NSC.ini do you have?
Also, in most cases you would put the //NoLogo after cscript, not after the script name
ie
Code: Select all
allow_arguments=1ie
Code: Select all
check_ad=cscript.exe //NoLogo scripts\check_ad.vbs /test:$ARG1$-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Re: Vbscript Help
Thanks Scott, that was it! FYI...I didn't have a NSC.ini file, I have nsclient.ini, and the line was allow arguments = false. I changed that to true and it worked!
Now I'm getting the following:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H IPADDRESS -t 30 -c check_ad -a "replications"
OUTPUT: OK - replications: OK.
Thanks so much for your help, I really appreciate it!
Now I'm getting the following:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H IPADDRESS -t 30 -c check_ad -a "replications"
OUTPUT: OK - replications: OK.
Thanks so much for your help, I really appreciate it!