I am trying to create an alert for when switch interfaces are almost full. I was unable to find any templates similar.
All of this data is already in LibreNMS and I am able to get the information needed by doing a direct SQL query but I am unsure how to make this an alert.
SELECT sysName,
COUNT(port_id) AS Ports,
SUM(ifOperStatus="up") AS UpPorts,
SUM(ifOperStatus="down") AS DownPorts,
ROUND(SUM(ifOperStatus="up") / COUNT(port_id) * 100) AS PortUtilization
FROM devices,ports
WHERE (devices.device_id = ? AND devices.device_id = ports.device_id)
GROUP BY devices.device_id
HAVING PortUtilization > 90