Good afternoon,
Can Hostmon monitor Application Pools within IIS for an up/down status?
Thanks,
Chris
Application Pool monitoring.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
HostMonitor doesn't have special test methods for IIS monitoring.
However, IIS provides WMI interface for application pool monitoring.
You may try to use "WMI" test method to check IIS Application pools state.
E.g. you may use WMI test method with query like the following:
select AppPoolState from IIsApplicationPoolSetting WHERE Name="W3SVC/AppPools/MSExchangeOWAAppPool"
AppPoolState may return one of the following 4 states:
1 - The application pool is starting
2 - The application pool has started
3 - The application pool is stopping
4 - The application pool has stopped
Please note: "Root\MicrosoftIISv2" WMI name space should be used for WMI query, specified above.
Please check the manual or visit our web site for more information at:
http://www.ks-soft.net/hostmon.eng/mfra ... ts.htm#wmi
However, IIS provides WMI interface for application pool monitoring.
You may try to use "WMI" test method to check IIS Application pools state.
E.g. you may use WMI test method with query like the following:
select AppPoolState from IIsApplicationPoolSetting WHERE Name="W3SVC/AppPools/MSExchangeOWAAppPool"
AppPoolState may return one of the following 4 states:
1 - The application pool is starting
2 - The application pool has started
3 - The application pool is stopping
4 - The application pool has stopped
Please note: "Root\MicrosoftIISv2" WMI name space should be used for WMI query, specified above.
Please check the manual or visit our web site for more information at:
http://www.ks-soft.net/hostmon.eng/mfra ... ts.htm#wmi
-
- Posts: 3
- Joined: Sun May 31, 2015 4:25 pm
Hey,
I want to get the state of application pools under IIS 7.0
That's not under root\MicrosoftIISv2, but under root\WebAdministration.
Unfortunately, the state is not a property but a method (GetState with parameter ReturnValue).
How can I get this value through a WMI query/test?
I want to get the state of application pools under IIS 7.0
That's not under root\MicrosoftIISv2, but under root\WebAdministration.
Unfortunately, the state is not a property but a method (GetState with parameter ReturnValue).
How can I get this value through a WMI query/test?
KS-Soft Europe wrote:HostMonitor doesn't have special test methods for IIS monitoring.
However, IIS provides WMI interface for application pool monitoring.
You may try to use "WMI" test method to check IIS Application pools state.
E.g. you may use WMI test method with query like the following:
select AppPoolState from IIsApplicationPoolSetting WHERE Name="W3SVC/AppPools/MSExchangeOWAAppPool"
AppPoolState may return one of the following 4 states:
1 - The application pool is starting
2 - The application pool has started
3 - The application pool is stopping
4 - The application pool has stopped
Please note: "Root\MicrosoftIISv2" WMI name space should be used for WMI query, specified above.
Please check the manual or visit our web site for more information at:
http://www.ks-soft.net/hostmon.eng/mfra ... ts.htm#wmi
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may may use Shell Script test method with custom made script.
E.g.
JS Script may look like the following:
Start cmd: cmd /c cscript /B /E:JScript %Script% %Params%
Script requires 1 or 4 parameters: <AppPoolName> [<IP/hostname> <Login Username> <Login Password>]
E.g.:
MyAppPool1
or
MyAppPool1 IISHOST1 User1 MyPassword
E.g.
JS Script may look like the following:
Code: Select all
statusUnknown = "scriptRes:Unknown:";
statusOk = "scriptRes:Ok:";
statusBad = "scriptRes:Bad:";
objArgs = WScript.Arguments;
if (objArgs.length==4) {
appPoolName = objArgs(0);
strComputer = objArgs(1);
strUser = objArgs(2);
strPsw = objArgs(3);
} else if (objArgs.length==1) {
appPoolName = objArgs(0);
strComputer = ".";
strUser = "";
strPsw = "";
} else {
WScript.StdOut.Write(statusUnknown + "Required 1 or 4 parameters: <AppPoolName> [<IP/hostname> <Login Username> <Login Password>]");
WScript.Quit;
}
try {
var objSWbemLocator = new ActiveXObject("WbemScripting.SWbemLocator");
var objWMI = objSWbemLocator.ConnectServer(strComputer, "Root\\WebAdministration", strUser, strPsw);
var wbemAuthenticationLevelPktPrivacy=6;
objWMI.Security_.AuthenticationLevel=wbemAuthenticationLevelPktPrivacy;
} catch(e) {
WScript.StdOut.Write(statusUnknown + e.message);
WScript.Quit;
}
var appPoolState = 0;
try {
var Obj = objWMI.Get("ApplicationPool.Name='"+appPoolName+"'");
var appPoolState = Obj.GetState();
} catch(e) {
WScript.StdOut.Write(statusUnknown + e.message);
WScript.Quit;
}
var apStatus = statusUnknown;
var apStatusText = "UNKNOWN";
switch (appPoolState) {
case 0:
apStatusText = "STARTING";
apStatus = statusBad;
break;
case 1:
apStatusText = "STARTED";
apStatus = statusOk;
break;
case 2:
apStatusText = "STOPPING";
apStatus = statusBad;
break;
case 3:
apStatusText = "STOPPED";
apStatus = statusBad;
break;
}
WScript.StdOut.Write(apStatus + apStatusText);
Script requires 1 or 4 parameters: <AppPoolName> [<IP/hostname> <Login Username> <Login Password>]
E.g.:
MyAppPool1
or
MyAppPool1 IISHOST1 User1 MyPassword