Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check IIS 7 Application Pool State
1.0
2011-12-02
- Nagios 2.x
- Nagios 3.x
GPL
112075
File | Description |
---|---|
Check_IISv7_AppPool_State.vbs | Check_IISv7_AppPool_State.vbs |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
This plugin is based on "Check IIS Application Pool State" by Vincent Besancon and modified to work for IIS 7.0 on Windows 2008 (R2).
Follow directions on Vincent's project about some working setup with Nagios.
Follow directions on Vincent's project about some working setup with Nagios.
Reviews (10)
bydjinlemage, March 13, 2018
Thank you, really helpful.
To hide the header, add // NoLogo to
[/ settings / external scripts / wrapped scripts]
check_iis_apppool_state = cscript.exe scripts \ check_iis_apppool_state.vbs $ ARG1 $
-->check_iis_apppool_state=cscript.exe //NoLogo scripts\check_iis_apppool_state.vbs $ARG1$
To hide the header, add // NoLogo to
[/ settings / external scripts / wrapped scripts]
check_iis_apppool_state = cscript.exe scripts \ check_iis_apppool_state.vbs $ ARG1 $
-->check_iis_apppool_state=cscript.exe //NoLogo scripts\check_iis_apppool_state.vbs $ARG1$
bytransom324, July 26, 2016
We have an EMR with 8 IIS application pools any of which may or may not start after a server reboot. This is huge for us! We don't mind the Microsoft (R) Windows Script Host Version in the Status Information field. Thanks.
byCaptainChaos, June 25, 2015
It also works with Windows Server 2012 R2 and IIS 8.5
bymkandoth, February 11, 2015
"Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved."
OK! iMISapp: STARTED
Copyright (C) Microsoft Corporation. All rights reserved."
OK! iMISapp: STARTED
For NagiosXI users, this is what I had to do to get this working.
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.
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.
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.
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.
it requires you have installed on the IIS Server, "IIS Management Scripts and Tools"
but the pool names with spaces cannot be checked.
' for pool names with spaces
numargs = WScript.Arguments.Unnamed.length - 1
for i = 1 to numargs
'WScript.Echo(" " + WScript.Arguments.Unnamed.Item(i))
strArgAppPool = strArgAppPool & " " & WScript.Arguments.Unnamed.Item(i)
next
' for pool names with spaces
numargs = WScript.Arguments.Unnamed.length - 1
for i = 1 to numargs
'WScript.Echo(" " + WScript.Arguments.Unnamed.Item(i))
strArgAppPool = strArgAppPool & " " & WScript.Arguments.Unnamed.Item(i)
next
Hi, I'm the author of the original plugin. Thanks for this, it is difficult for me to maintain the original one today... good to know that people improve it ;-)
But, good news, I will have the opportunity to work on a new one that will use WS Management Protocol. This will support new Windows Server version and avoid the use of a Nagios Agent (NSClient).
Keep up the good work !
But, good news, I will have the opportunity to work on a new one that will use WS Management Protocol. This will support new Windows Server version and avoid the use of a Nagios Agent (NSClient).
Keep up the good work !
bytomerof, March 4, 2012
i was looking for that solution for a long time ^_^ thank you!!
bybrianhonaker, January 18, 2012
This does exactly what I need it to. Now if we could find one that works at the site ID level to monitor if the site is stopped or not.