问题
I am looking for a script with appcmd, that will monitor the IIS application pools and we can also get email notifications when some apppools are crashed. We want to put the script as a scheduler task.
回答1:
I suggest you combine the information from these two resources
- http://technet.microsoft.com/en-us/library/cc771701(v=ws.10).aspx
- http://blogs.msdn.com/b/amb/archive/2012/10/18/how-to-get-an-application-pool-configuration-with-appcmd-exe.aspx
But in summary you can use appcmd to return a list of sites which are not in a state of "started";
e.g.
appcmd list apppool /state:"Stopped"
来源:https://stackoverflow.com/questions/15957485/appcmd-script-that-will-monitor-iis-app-pools-and-send-email-if-application-pool