I am looking for a way to keep track of unused ports so we can proactively install switches as data closets near capacity. I've implement's Joe Clarke's EEM policy with TCL scripts to disable unused ports after a specified period of time. I would like to add logic into the current "tm_suspend_ports.tcl" script to do the following:
1) get a total count of ports on the switch using "show interfaces status | ex DO NOT DISABLE" or similar; some way to determine all the available ports.
2) get a count of disabled ports using "show interfaces status | in disabled" and store the results to a different variable or similar; some way to determine all administratively disabled ports
(Possible combine steps 1 and 2 into a single step / clause?)
3) Take a percentage of disabled vs. total; quantity would equal the percentage of available ports
4) If the percentage is less than 10 percent - send an SNMP trap and/or generate a SYSLOG message with the word "CRITICAL"; the alerts will be collected by the NOC and a technician can be dispatched to add a switch to the stack.
5) If the percentage is less than 20 percent - send an SNMP trap and/or generate a SYSLOG message with the word "WARNING";
I am in the process of learning TCL but unfortunately my timeline for the project is up and I need some help.