I’ve been digging around in my database, trying to figure out why I have a large number of ports listed in my observium interface, compared to the number of devices I have. I have discovered several devices that were removed (via delete_device.php)
a while back, but it seems that the ports table wasn’t completely cleaned up. These devices were removed from the devices table:
mysql> select * from devices where device_id in(45,66,67,68,69,70,71,72,73);
Empty set (0.00 sec)
mysql>
But the ports for these devices weren’t entirely removed:
mysql> select device_id,count(*) as "number of ports" from ports where device_id IN(45,66,67,68,69,70,71,72,73) group by device_id;
+-----------+-----------------+
| device_id | number of ports |
+-----------+-----------------+
| 45 | 4153 |
| 66 | 4153 |
| 67 | 4153 |
| 68 | 4153 |
| 69 | 4153 |
| 70 | 1569 |
| 71 | 4153 |
| 72 | 4153 |
| 73 | 4153 |
+-----------+-----------------+
9 rows in set (0.01 sec)
mysql>
These devices were probably F10/Dell M1000e cards, which I removed from observium because of the large number of l2vlan interfaces on each was causing a processor burden when polled. Rather than fight with them, I just removed them.
My question is this, how can I clean up the remnants? Can I just delete these orphaned ports from the table? Or will I break anything if I do that?
Thanks