I have to systems, Main and Backup, and use a TCP sensor to monitor if an especific port is active, but only the Main is active so the same sensor in the backup system is always in fail. Only when Main fails the backups turns to active.

Its possible to add some kind of dependencies but negate, so when the TCP sensor in the Main system its OK, the TCP sensor in the backup system is paused, and when the main fails resume the TCP sensor in the backup system.


Article Comments

Hello there,

Sure, there is a way to achieve this. For this you will need to work with API calls and a notification template which uses the "Execute HTTP action" as notification method.

You can "pause" and "resume" a sensor using following API calls:


Pause
/api/pause.htm?id=objectid&pausemsg=yourmessage&action=0


Resume
/api/pause.htm?id=objectid&action=1

I have included the "Object Manipulation Manual" for further details. See link below: https://www.paessler.com/manuals/prtg/object_manipulation#pause_resume

For your notification template you will need to enable the "Execute HTTP action" and adjust the API calls above and replace the objectid with the sensor ID.

Now you can configure the notification trigger with a notification template which pauses the other sensor to be triggered when sensor status is "UP".


This means that when the sensor goes up, PRTG will execute the HTTP action.
To resume the paused sensor in case when the main is down, you will need to setup a second notification trigger to be triggered when sensor status is "DOWN".


Of course you will need to repeat the same for your backup sensor.

I have included a detailed PRTG Manual: on "Notification Triggers Settings". Find link below: https://www.paessler.com/manuals/prtg/sensor_notifications_settings

Furthermore, I have attached a PRTG Manual for Notification Templates as well. See link below. https://www.paessler.com/manuals/prtg/notifications_settings


Kind regards
Jeremiah Katatumba - Technical Support


Mar, 2023 - Permalink