We’ve had a number of customers asking how they can monitor their IIS application pools’ status. It turns out there is a handy performance counter that can do that.
Note that a value of 3 is ‘Running’. So you just need to create a Performance Monitor to watch the counter for your instance and make sure it is set to 3.
So you setup your monitor and life is good:
But then you decide you want to monitor all the App Pools, not just one. And you don’t want to setup monitors one by one for this. Instance Wildcards to the rescue!
There is just one pesky little problem with this. The _Total instance really is a total of the other values. So if you have 5 App Pools that are all running, it will have a value of 5 x 3 = 15.
Good news though. If you are using 7.1 (in Preview at the time of this writing), the counter path supports Regular Expressions! So now you can create a path that will expand to all App Pools that start with an upper or lower case letter, or a number.
With that, all _real_ application pools will be checked to see if they are in a Running state.
See more on the documentation page.