Build precise queries to find exactly what you need
Press ESC to close
For NagiosXI users, this is what I had to do to get this working.
1. Add the vbs script to C:Program FilesNSClient++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.
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.
4. In Nagios, again in Core Config, create a service that references the command.
In $ARG1$, simply put the name of the Application Pool. Go ahead and test the check command, it should work. Save it then apply the configuration.
Hint- if you have not created services before, an easy way to do it is to simply copy it from an existing service on the host you are aiming for so you get the correct alert settings.
***SPECIAL NOTE*****
If your AppPool name has a space and – , you will have to change the name of the AppPool. I’ve tried using the old faithful method of quoting along with escaping, but it just does not get passed correctly to NPRE and it will fail. You can have hyphens, just no space hyphen.
If you followed my directions and it still does not work, well then you probably did not follow my directions. Go thru the steps and try again (-;
Good Luck and May the Force be With you.
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!