Device


Generic Management

Chassis-Serial-Num
Count-CAM-Table
Discard-Alarm
Default-Route-Alarm
Find-IF-Problems
Find-IF-Top-Broadcasters
Find-IF-Top-Unicasters
Find-Span-Ports
Inv-Hardware
Inv-Image
Mass-Ping
Named-IF-Alarm
OSPF-Alarm
Porter-Report
Redundancy-Testing
Reset-Device
Seq-Reboot

Show-If-Errors
Twiddle-Interface
Verify-SNMP-Access-Alarm
WAN-Circuit-Alarm
WAN-Circuit-Details

Generic Management

The Scripts

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.

Default-Route-Alarm examines a list of routers and whines if it sees discrepancies between their view of the default route.

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.

Find-IF-Top-Broadcasters takes a list of devices as arguments and produces a report which ranks, within each device, the interfaces which have transmitted the most broadcast + multicast packets.

Find-IF-Top-Unicasters takes a list of devices as arguments and produces a report which ranks, within each device, the interfaces which have seen the most ifHCInPkts + ifHCOutPkts.

Find-Span-Ports takes a list of devices as arguments and describes the ports on each device which are in 'span' or 'mirror' mode.

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.

Inv-Image takes a list of devices as arguments and produces a three column report consisting of the device name, the hardware type, and the currently running image name.

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.

Named-IF-Alarm looks through devices for interfaces with defined ifAlias values and whines if such an interface is operationally down or if the interface reports errors.

OSPF-Alarm examines OSPF routers for health parameters and whines if it detects trouble.

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.

Seq-Reboot takes a list of devices as argumen ts and reboots them in turn, waiting for each one t o return to life before continuing to the next and bailing if a device does not return to life.

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.

Twiddle-Interface takes an interface designator as an argument plus various action parameters and then fiddles with that interface's ifOperStatus: enabling and/or disabling it in various ways.

Verify-SNMP-Access-Alarm takes a list of devices as arguments and reports whether we know a read-only community string or not, alarming via e-mail for those which we do not.

WAN-Circuit-Alarm takes a list of devices as arguments and reports on the status of administratively enabled WAN ports, notifying operators by e-mail if any seem troubled.

WAN-Circuit-Details takes a list of devices as arguments and reports on the configuration of administratively enabled WAN ports.


Prepared by:
Stuart Kendrick

Last modified: 2016-October-15