I pretty new with LibreNMS. I want to configure an alarm for port down/up to work in the next way:
When the port is down, it sends a notification with port down
When the port recovers from down to up, it sends a notification with port up
The rule is: SELECT * FROM devices,ports WHERE (devices.device_id = ? AND devices.device_id = ports.device_id) AND ports.ifOperStatus = “down” AND ports.ifOperStatus_prev = “up”
My problem is that I receive notification only when the port is down. Even if it recovers, I still receive notification with port down. I must turn off the alarm to don’t receive any more notifications with port down. It’s like getting in a loop.
I’m thinking it’s the way your rule is structured with the ports.ifOperStatus_prev. Try removing the ports.ifOperStatus_prev so the rule will alert if the port status = down, but when the port is anything other then down then send recovery alert.
Beats me, as long as you have recovery email ticked (which you do per your last screenshot) it should be emailing you once the port is not Down reporting as recovered
Try my exact rule using the macros_port_down and settings as mine 100% works for down and up.