Skip to content

Instantly share code, notes, and snippets.

@ragingcomputer
Last active March 4, 2022 20:55
Show Gist options
  • Save ragingcomputer/9c24559a3682929ad2cd8ff55000999d to your computer and use it in GitHub Desktop.
Save ragingcomputer/9c24559a3682929ad2cd8ff55000999d to your computer and use it in GitHub Desktop.
LibreNMS Custom Alert for Spanning Tree STP Blocking Ports

LibreNMS Custom Alert for Spanning Tree STP Blocking Ports

LibreNMS Advanced Alert Spanning Tree Blocking Ports

This can be configured as an Advanced Alerting Rule https://docs.librenms.org/Alerting/Rules/#advanced

Create a new rule and give it a name

Then switch to Advanced tab, enable Override SQL, and paste the following line into Query

SELECT * FROM devices,ports WHERE ports.device_id = ? AND devices.device_id = ports.device_id AND ports.port_id IN ( SELECT ports_stp.port_id FROM ports_stp WHERE ports_stp.state = "blocking") 

Then Save Rule

SELECT * FROM
devices,ports
WHERE
ports.device_id = ?
AND devices.device_id = ports.device_id
AND ports.port_id IN (
SELECT ports_stp.port_id
FROM ports_stp
WHERE ports_stp.state = "blocking"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment