Multiple Port Down Alerts for a Single Device

Hi,

I’m trying to configure LibreNMS alert rules to trigger separate alerts for each port that goes up/down on a single device. Currently, I only receive one alert per device, even when multiple ports are down. How can I achieve individual alerts for each port?



Alert Rules:
SELECT * FROM devices,ports WHERE (devices.device_id = ? AND devices.device_id = ports.device_id) AND ports.ifAdminStatus = “up” AND (ports.ifOperStatus = “down” && ports.ifAdminStatus != “down” && (ports.deleted = 0 && ports.ignore = 0 && ports.disabled = 0)) = 1 AND (ports.ifAlias LIKE ‘%C9120AXI%’ OR ports.ifAlias LIKE ‘%C9124AXI%’ OR ports.ifAlias LIKE ‘%CAP2702I%’ OR ports.ifAlias LIKE ‘%IW9165DH%’)

Alert Template:
@foreach ($alert->faults as $key => $value)
@if ($alert->state == 1):exclamation:🛜AP {{ $value[‘ifAlias’] }} is DOWN @endif
@if ($alert->state == 0):white_check_mark:🛜AP {{ $value[‘ifAlias’] }} is UP @endif

Time: {{ $alert->timestamp }}
Time elapsed: {{ $alert->elapsed }}
Switch: {{ $alert->sysName }} - {{ $value[‘ifDescr’] }}

@endforeach

I’ve not seen this to be possible what you’re asking to occur out of a single Alert. When you create these alerts and match it against a device, that device will only trigger or not trigger that alert should the content of that alert be triggered by that device and then it’ll generate only a single alert for it. I believe the idea is that when the alarm triggers by expanding that alarm it’ll specify which ports are alerting. That said there is then another complication of the ‘got worse’ and ‘got better’ alarms should the situation change while the alert is triggered.

Thats just my 2 cents.

Basically what Speechy says. You can’t alert on a per port basis.

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