Why is this rule being triggerred?

I have a server that is activating a critical temp rule when it shouldn’t be. I’m probably missing something obvious and hoping someone could point it out to me. My rule is:

The current temps:

…and the output from an alert capture:

Rule name: Temperature - Critical
Alert rule: sensors.sensor_current >= “sensors.sensor_limit” AND sensors.sensor_class = “temperature”
Alert query: SELECT * FROM devices,sensors WHERE (devices.device_id = ? AND devices.device_id = sensors.device_id) AND sensors.sensor_current >= “sensors.sensor_limit” AND sensors.sensor_class = “temperature”
Rule match: matches

Any ideas what could be causing this? Thanks in advance.

I’m by far not an expert with Librenms but i have a similar rule that seems to be functioning reasonably well
One of my major differences is that i have the below included in my rule as well:

My understanding is that this will read the alert status of the sensor (0=okay, 1=warning, 2=critical, 3=unknown) IAW this doco Device Sensors - LibreNMS Docs

so by adding this into your rule it should only run as true when the state of a sensor enters the warning/critical (depending how you configure it) status on the current temps page

1 Like

You need to escape out sensors.sensor_limit so the rule engine knows you’re referring to a variable, and not the literal string of “sensors.sensor_limit”.

To escape it out, surround with a single ``.

I would tell you what to put in, but the forum keeps formatting it as pre-formatted text. :laughing:

1 Like

This should be a decent example of the escaping described by @electrocret



Problem solved. Thanks guys!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.