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)
🛜AP {{ $value[‘ifAlias’] }} is DOWN @endif
@if ($alert->state == 0)
🛜AP {{ $value[‘ifAlias’] }} is UP @endif
Time: {{ $alert->timestamp }}
Time elapsed: {{ $alert->elapsed }}
Switch: {{ $alert->sysName }} - {{ $value[‘ifDescr’] }}
@endforeach


