The following script will act as a workaround for the native sensor, which sometimes has connection troubles. While the problem looks simple to fix, it's more than a mere bugfix. It's buried deep within the Performance Counter framework we're using and is a lot of work to fix (with unforseen caveats). Hence we came up with the following.
Caution
The culprit however is, that in order to work properly you need to configure PRTG's Probe service to run in the context of a user that is allowed to access the targeted hosts (by default it runs in the context of "Local System"). So usually this should be a domain admin, that way you make sure that all sensors requiring Windows credentials work properly.
It will basically do the same/retrieve the same metrics as the IIS App Pool sensor, but using a powershell script to do so.
Here's what to do to get the custom sensor running:
- Save this script in PRTG's install directory into subfolder "....Custom Sensors\EXEXML"
- Add an EXE/Script ADVANCED sensor to the IIS device in PRTG
- Select the script from the dropdown
- Set parameters as shown in the image attached, while the name behind "instance" reflects the name of the desired app pool.
Let it run for some time additionally to the standard IIS App Pool sensor and let us know if this runs more "stable" than the IIS App pool sensor or if both are failing around the same time.
In case you have trouble getting the powershell sensor to run, please find here more details what to take care of:
Guide for PowerShell-based Custom Sensors
Kind regards,
Stephan Linke, Tech Support Team
Add comment