These PERL scripts help us manage our flock of switches & routers. They rely on IETF-standardized MIB variables or on enterprise MIB variables drawn from a variety of manufacturers.
Chassis-Serial-Num takes a list of devices as arguments and produces five column report consisting of the device name, the manufacturer, the hardware type, the chassis' serial number, and an owner (internally defined).
Count-CAM-Table takes a list of switches as arguments, counts the MAC addresses listed in dot1dTpFdbAddress for each VLAN, sums them, tosses the result for each device into syslog, and appends to a log file.
Discard-Alarm runs every night, polls the interfaces on a list of devices (typically switches & routers) for ifInDiscards and ifOutDiscards, and keeps track of the result in a text database. It produces a summary report and a detailed report and sends e-mail when it notices interfaces exceeding a configurabeable threshold of discards. We haven't figured out how to use this yet.
Find-IF-Problems takes a list of devices as arguments and lists the ports on each device which have seen errored packets or have dropped packets due to resource constraints.
Inv-Hardware takes a list of devices as arguments and produces a three column report consisting of entPhysicalModelName, entPhysicalDesc, and a Count, totalling all the parts one owns within that list of devices.
Mass-Ping pings many devices across an extended time period (user-defined and interruptable via Ctrl-C), recording hit and missed pings in a CSV file. Graph-Mass-Ping takes that CSV file as input and produces a graphic illustrating the hit and missed pings. Useful for quantifying the effect of a network path change on reachability to a range of end-stations.
Porter-Report runs every night, walking ifOutOctets on every device (typically switches). It stores the result in a text database, watches for changes, and produces a detailed report as well as several summary reports. If a given interface's ifOutOctets count has not incremented for 30 days, then that port appears in the detailed report. We then know that this port hasn't seen activity for at least 30 days ... is not attached to an active device ... and is available for use elsewhere. If someone needs an ethernet connection off that switch, and if all the ports on the switch are physically connected to jacks, we yank the connection to one of these "idle" ports in order to make room for the new device. Ron Hood wrote the original version of this script -- this original version supports hubs.
Reset-Device takes a list of devices as arguments and reboots them.
Show-IF-Errors takes a list of switches as arguments and displays which switches, and which interfaces, are reporting FCS and/or late collisions errors. This script stands by itself -- it doesn't require the Netops modules, and I take some effort to make it more portable than most of the Netops Toolkit: I use fewer modules and stay away from features only available in newer versions of Perl.
Last modified: 2016-October-15