I haven't ever used any "out-of-the-box" plugins but I followed the instructions in the comments but I am getting this message:
Code: Select all
./check_nrpe -H eas4t -t 30 -c check_iis_apppool_state -a "EasServices"
Unknown command(s): check_iis_apppool_state
Here is what I have done.
1. Add the vbs script to C:\Program Files\NSClient++\scripts
I renamed mine to: check_iis_apppool_state.vbs
Also assumed you have installed the 64bit version.
2. In your NSCLIENT.ini file, add the following:
a. Settings for your external scripts
[/settings/external scripts]
allow arguments = 1
allow nasty characters = 1
timeout = 90
b. A Wrapped scripts section
[/settings/external scripts/wrapped scripts]
check_iis_apppool_state=cscript.exe scripts\\check_iis_apppool_state.vbs $ARG1$
c. the wrappings section
[/settings/external scripts/wrappings]
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
exe = cmd /c %SCRIPT% %ARGS%
* You don't need to create an alias.
The way this works is that nagios will use npre to call check_iis_apppool_state, which in turn will call csript, which since it's an exe will require the exe wrapper. And since your calling a vbs, you need the vbs wrapper.
Saved the nsclient.ini file and restarted the NSclient service.
3. In Nagios, create a new command. For those of you who have not created commands before, This is done in Core Config.
I called my command: check_iis_apppool_state
The important part of the command is that whatever is after the -c , must match what you put in your ini file.
Mine looks like this:
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_iis_apppool_state -a "$ARG1$"
MAKE SURE YOU QUOTE $ARG1$ or else you will spend hours trying to figure out why it is not working. In other words, copy and paste exactly what it looks like.