Hello,

i'm currently evaluating PRTG for a special use case:

I have two SNMP devices with a identical set of sensors. I'd like to execute a script in case of a sensors reaches a threshold or changes a state. But i'd like to combine two sensors of different devices.

Device 1, Sensor 1 -> OK Deivce 2, Sensor 2 -> FAIL -> Execute Script 1

Device 1, Sensor 1 -> FAIL Deivce 2, Sensor 2 -> OK -> Execute Script 2

Device 1, Sensor 1 -> FAIL Deivce 2, Sensor 2 -> FAIL -> Execute Script 3

Is there a way to get with done with PRTG?

Thank you


Article Comments

Hi Marcel,

I'd suggest using Sensor Factory sensors for this use case. Then you can combine sensors from different devices.

So create one Sensor Factory sensor for each case and try covering all of the notification cases with them. I'd propose the following approach:

  1. Create a Sensor Factory for the third case and include all desired channels of both sensors.
  2. For Error Handling choose Use Custom Formula.
  3. Define the following formula: status(id_of_sensor1) AND status(id_of_sensor2)
    1. This status formula will set the Sensor Factory to Down only if both source sensors are down.
  4. Add a State Trigger for the Down Status of the Sensor Factory. Because the Sensor Factory will only go down if both source sensors are down, this will cover your third case. So select the "Execute Script 3" notification for this trigger.
  5. Add a Sensor Factory for case 1: Combine the desired channels of both source sensors as usual. As status definition use this formula: status(id_of_sensor2) AND NOT status(id_of_sensor1)
    This will set the Sensor Factory to Down only if the second sensor is down. Add a State Trigger for Script 1 accordingly.
  6. Add a Sensor Factory and a notification trigger for case 2 the same way with the status function status(id_of_sensor1) AND NOT status(id_of_sensor2)

For more details about using the Sensor Factory, please see the manual.


Jun, 2014 - Permalink

Thank you very much. This meight be work I will take a look after my vacation next week!


Jun, 2014 - Permalink

Hi!
First, thanks for this little tutorial. I tried to follow it (also the official manual about the factory sensor) but I still don't quite get it...
I tried to monitor 2 separate pings of two devices and tried to use the AND-operation like in your first example but the sensor still goes down when only one of the pings fails.

This is my config:
config factory sensor

Maybe you could tell me, what I'm doing wrong?
Thanks a lot in advance!


Jun, 2022 - Permalink

Hi lain123,

While I appreciate your effort, I'd suggest a different approach. The article that you've followed is from 2014 and there is something more appropriate for that scenario.

I would realize this using the Business Process sensor instead.

Please check the following articles that will help you to create a suiting sensor:
How can I use the Business Process sensor?
How does the Business Process sensor calculate summarized sensor states?

The thresholds for two Ping sensors are 33% and 66% to change the sensor state to Warning (if one Ping sensor fails) and Down (if both Ping sensors are down).

Best,
Sebastian


Jun, 2022 - Permalink

Hi Sebastian

Thank you very much for your answer! That was exactly what I was looking for.

Regards Iain


Jun, 2022 - Permalink

Glad that I could help :)


Jun, 2022 - Permalink