I would like to create a sensor that monitors a pool of redundant servers that will alert if the number of healthy servers is less than 5. I would like to do this without coming up with a list of every sensor ID, so that it would be dynamic if additional servers were added.
example: health check on webserver1, webserver2, webserver3, webserver4, webserver5, webserver6, webserver7 all tagged 'pool1'
if number of down webservers with tag pool1 > 3 custom sensor goes to Down.
Thanks
-chuck
Article Comments
Thanks for that information. How is that used inside PRTG to notify if a number of sensors in the tagged pool are in Down state?
It returns:
<?xml version="1.0" encoding="UTF-8"?> <sensors totalcount="25" listend="1"> <prtg-version>15.1.14.1778</prtg-version> <item> <sensor>tomcat_ok.jsp</sensor> <status>Up </status> <status_raw>3</status_raw> </item> <item> <sensor>tomcat_ok.jsp</sensor> <status>Up </status> <status_raw>3</status_raw> </item> <item> <sensor>tomcat_ok.jsp</sensor> <status>Up </status> <status_raw>3</status_raw> </item> <item> ... </sensors>
Mar, 2015 - Permalink
And....
if you feed the url from the example above to the HTTP XML/REST Value Sensor, you can easy count the number of nodes in the XML result. Using limits you can set the sensor to an error state if the number of nodes > 3.
This will save you from creating a Custom Sensor.
Mar, 2015 - Permalink
You can use the api/table.xml function and filter on a sensor tag like this:
This will list all sensors (and their status) having the 'pool1' tag.
Mar, 2015 - Permalink