What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Custom sensor to alert if number of sensors with a particular tag are down

Votes:

0

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

counter custom-sensor prtg tags

Created on Mar 27, 2015 4:57:29 PM



3 Replies

Votes:

6

You can use the api/table.xml function and filter on a sensor tag like this:

http://yourserver/api/table.xml?content=sensors&columns=sensor,status&filter_tags=@tag(pool1)

This will list all sensors (and their status) having the 'pool1' tag.

Created on Mar 30, 2015 1:17:37 PM



Votes:

0

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>

Created on Mar 30, 2015 3:15:16 PM



Votes:

4

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.

Created on Mar 30, 2015 4:18:11 PM

Last change on Jul 26, 2021 11:32:21 AM by  Maike Guba [Paessler Support] (2,404) 2 1




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.