I have a network switch that I’d like to monitor a specific port. Alerts/Transports are working as I get an Alert when I unplug the switch from the network (test switch).
I’d like to monitor a specific port (where I have a network printer attached). If this port is unplugged/goes down/etc I’d like to receive an alert.
Navigating to the interface graph for the specific port (4) and showing the ‘rrd graph command’ I see that the port has an ID of 933.
I’ve created a specific rule for this device and the rule is set as ‘ports.ifName equal id933’ or ‘ports.ifName equal 933’ as I’m not sure which is correct (maybe they are both wrong)?
I set Max alerts to 1 with a Delay of 5m and an Interval of 0. I only want to receive an alert when the port drops and if/when the port is back up.
When I unplug the device from port 4 and give librenms enough time to update polling, I see that the interface is showing as down in librenms, but the alert never arrives. I am not physically unplugging the device, I’m simply using the CLI command to shutdown the port, I don’t know if this matters.
Is ports.ifName the correct option to use or should I be using something else? Do I need to make any adjustments in any other settings on the device within LibreNMS?
Edit- I do believe that administrative down is different from a device being unplugged from the port, so I’ve edited my rule to include a port that I am physically able to unplug. I still can’t get the rule to work. I must be missing something simple because monitoring and alerting on a single port seems like it should be something very simple to configure.
Also, I found this in the librenms documentation, but it is for Any port and not a specific port.
Any port changes: ports.ifOperStatus != ‘up’