Alert Rule Sanity Check

I have a rule:

%devices.type = “Power” && %sensors.sensor_class = “voltage” && %sensors.sensor_current > “sensors.sensor_limit”

This creates an alert for every device that is “power” regardless of the voltage and or sensor_current vs. sensor_limit.

I feel like this should only alert if the device is type “Power”, and the “sensor_class = voltage” and “sensors_current > sensor_limit”.

Am I doing this wrong? I’ve read the docs on alerting a lot, and I’m feeling like something is not working as intended.

I’m updated to the latest code base. Validate passes etc.

Anyone has a suggestion I’d grateful, I’ve spent far to much time trying to create this alert. :frowning:

Thanks!
J

I think you’re missing a percent in your > statement.

%sensors.sensor_current > %sensors.sensor_limit

You have to put the % in yourself in that case.

I did mine a tad differently, but the idea is the same (and it works as expected):

%sensors.sensor_current >= %sensors.sensor_limit && %sensors.sensor_alert = “1” && %macros.device_up = “1” && %sensors.sensor_descr ~ “oltage”

1 Like

what are you trying to alert off of? ups or pdu?

PDU, but I think @lawngnome is correct, I missed the % on that.

-J

1 Like