I would suggest to use customized web page template for the PRTG webserver, that displays the number of sensors in paused/warning/OK etc. status, plus a HTTP content sensor, that monitors this value.
Step 1: Creating your own API function
- Create a new textfile "getsensorsbystate.htm" in the \website\api folder of your PRTG installation
- Edit the file in a text editor, paste the following code, and save the file:
[<#graph graphcontent="statusoverview" show="textraw">]
Step 2: Creating a HTTP Content sensor to monitor the value
Create a new HTTP Content sensor and enter the following URL:
http://yourprtgserver.ip/api/getsensorsbystate.htm?name=downsens&username=xyz&password=abc
This URL will display the total number of sensors which are in Error state (red), shown as a number between brackets [].
[8]
Please note: If there is no sensor in error state, the brackets will only contain a whitespace:
[ ]
The HTTP Content sensor reads this information and uses it as sensor values. Now your can use limits and triggers to send notifications.
The possible values for the "name" parameter are:
| Name | Description |
| upsens | Up sensors |
| downsens | Down sensors |
| downacksens | Acknowledged Down alarms |
| warnsens | Warning sensors |
| unusualsens | Unusual sensors |
| pausedsens | Paused sensors |
| undefinedsens | Unknown sensors |
| totalsens | Total sensors |
You can only request one value per request/sensor. So in order to monitor unknown and error sensors you need to set up two HTTP Content sensors.
Please have a look at the API documentation for more information about using the HTTP API:
How can I use the PRTG application programming interface (API)?
Add comment