Alert rules help

What am i doing wrong?

%sensors.sensor_oid = “iso.3.6.1.2.1.33.1.4.1.0” && %sensors.sensor_current = 2 && %devices.os ~ “APC”

I want it to trigger when the oid returns “2”.
doing a walk against the oid returns the value 2, but i dont get any alerts…

(i know state normal is 2, i just want it to trigger all, before i make it an !=2)

I have also tried with:
%sensors.sensor_oid = “.1.3.6.1.2.1.33.1.4.1.0” && %sensors.sensor_current = 2 && %devices.os ~ “APC”

and i have tried:

$config[‘alert’][‘macros’][‘rule’][‘APCpoweroff’] = ‘%sensors.sensor_oid = “.1.3.6.1.2.1.33.1.4.1.0”’;

and then a
%macros.APCpoweroff=1 && %sensors.sensor_current = 2 && %devices.os ~ “APC”

to mention also, i have tried without the device.os without any luck

Hi there,

Is the data already collected by Libre?
You can verify that by doing the following SQL:

SELECT * FROM sensors WHERE device_id = X;

Yes it is, and its on a rrd graph also.

would be sweet with an easier way to create alert rules

What exactly are you trying to alert on the APC? Did you check the alerts collection we lots alerts on APC?

Are you sure this sensor is listed on the device in librenms??? What is the sensor name, can you post a screen shot of the sensor?

Im not seeing this sensor listed in librenms. In order to alert off a sensor or OID it has to be in librenms or in device os file.

the alert already exists in the sensor out of limits, but i need to make it more visible, so the specific sensor gives another title, so its easier to distinguish.

the output status is 2 when online, 1 when battery powered

John, we have an alert rule already for UPS output status running on battery, see the alerts collection And it will return a 3 on output status. If you really want you could select the rule and edit change the return to 2.

image

2 Likes

looks like exactly what i’ve been searching for! i’ll try it out, and thanx!

1 Like