Bulk editing Observium ports

I was introduced to Observium a couple of years ago, and it is a fantastic tool for network monitoring – specifically the actual network (Switches / Routers / Firewalls / etc). I haven’t shut up about it since. It has forked out a few times now (software like LibreNMS) which at some point i should check out but i still like Observium.

Recently I started a new job and I rolled out Observium to get some quick visibility over our network. Quick and dirty tool to sort some issues.

We have a heap of Dell switches in the network which were showing all the possible port channels to SNMP even though they weren’t configured – think Po1 to Po128. Across like 60 switches.

I had 2 options –
1) Disable them all on the switches – BAD idea (config bloat)
2) Disable them in Observium

I went with option 2 – but changing this on 60+ switches was going to take agessssss. So I SQLd it
The below can be used to bulk change the status of the ports in Observium.

This one will show all ports on the device ID, where the port name is like Po, the Operating status is down and the Admin status is up.

SELECT port_label,disabled,`ignore` FROM ports WHERE device_id = 'your device id' AND port_label LIKE 'Po%' AND ifOperStatus = 'down' AND ifAdminStatus = 'up';

Tweak as needed obviously to get familiar with what you are doing, and then work towards disabling.

You can then run the below to Disable polling and alerting on all Po interfaces on ALL switches where they are down (eg it will not touch the ones that are up)

UPDATE ports SET disabled = '1',`ignore`='1' WHERE port_label LIKE 'Po%' AND ifOperStatus = 'down' AND ifAdminStatus = 'up';

So this is probably a good place to start if you need to disable ports in bulk

In the database:

disabled = 0 means FALSE. Observium WILL poll the port
disabled = 1 means TRUE. Observium will NOT poll the port 
ignore = 0 means FALSE. Observium WILL alert on the port (port down list etc)
ignore = 1 means TRUE. Observium will NOT alert on the port (will show up in ignored list of ports)

Good luck!

Leave a Reply

Your email address will not be published.

Blue Captcha Image