Alert for Sensor State


Anybody got an example for Alert Rule for Sensor State?

Here’s what I got but it’s not working…
%sensors.sensor_type ~ “state” %sensors.value = “1” || %sensors.value = “2” &&

You can’t do && and || in the webui, you’ll need to create a macro.

No point in doing ~ state, just do equals state.

Got it thank you sir- :slightly_smiling_face:

does this look ok for a macro?

$config[‘alert’][‘macros’][‘rule’][‘HP Procurve Sensor States’] = ‘%sensors.sensor_oid=“”’;

Well it’s an unnecessary macro as it could just be put in the rule itself.

But yes it should be ok (assuming that oid is correct, they usually start with a .

1 Like