Welcome to the Netops project on SourceForge.Net. This project hosts Perl scripts which manipulate Layer 0 - 4 devices on enterprise networks.
The scripts are broadly chunked as follows:
They rely heavily on the Net-SNMP Perl Module. They support multiple ways to specify targets, from a command-line list to a text file to regex parsing of a hosts table.
sb-alarm takes a list of SwitchBlades as arguments and scans various MIB variables for hardware problems, producing a report -- if it detects problem, it notifies via e-mail.
ups-battery-status produces a report listing battery status, temperature, capacity, load, run-time, last date of calibration, and battery replacement flag.
ups-calibrate initiates the calibration function.
ups-chassis-status produces a report listing parameters relevant to the UPS as a whole, rather than focussed on its batteries.
ups-config uploads an AP96xx config file produced by ilc301.exe.
ups-hardware produces a report listing firmware, serial numbers, model names, and manufacturing dates.
ups-io-status produces a report listing input and output current, voltage, and load.
ups-problem-report produces a report listing UPSes reporting problems and e-mails the result to interested parties.
ups-reset reboots AP96xx cards.
ups-set-stuff sets date/time plus name in AP96xx cards.
ups-software produces a report listing the software/firmware revisions of AP96xx and the underlying UPS.
ups-upgrade uploads both the operating system image (aosXXX.bin) and and the 'overlay' or 'application' or 'platform' image (sumxXXX.bin, syXXX.bin, dpeXXX.bin).
altiga-alarm takes a list of Altiga (now Cisco) VPN concentrators as arguments and scans various MIB variables for hardware problems, producing a report -- if it detects any problems, it notifies via e-mail.
auto-save takes a list of devices as arguments and compares startup-config to the version saved on the tftp server. If they are different, it updates the version saved on the tftp server and stores both 'before' and 'after' copies to a changetree.
chassis-serial-num takes a list of Catalyst devices as arguments and produces a report identifying the serial numbers of the chassis' housing those devices.
cisco-alarm takes a list of Cisco devices as arguments and scans various MIB variables for hardware problems, produces a report, and if it detects any issues, it notifies via e-mail.
mod-config takes a file name and a list of devices as arguments; it uploads the file to each target, merging it with running-config.
save-config takes a list of devices as arguments and uses tftp to save their config files to a change tree.
module-serial-num takes a list of Catalyst devices as arguments and produces a report identifying the serial numbers of the modules installed in those devices.
red-reboot reboots a list of devices in series, waiting to see that the rebooted device returns to life before continuing. During each operation, the script pings other devices, logging missed responses. At the end, it produces a report summarizing what happened when each device went down and then again when it returned to life. We run this script from cron monthly to test our redundant architecture.
seq-reboot reboots a list of devices in series, waiting to see that the rebooted device returns to life before continuing.
set-vlan-param takes a list of devices as arguments and uses tftp to upload a config file snippet to each one. Before doing this, it queries each device for its list of VLANs and modifies the config file snippet appropriately for each device, substituting the list of VLANs for the string "xxxxxx" in the snippet. See example in the code.
shutdown-network takes a list of devices as arguments and disables or enables access-layer ports. This is a big hammer -- I've never actually run it in production. Intended as an emergency response to a catastrophic worm infestation amongst end-nodes.
upgrade-cat5000 takes an image file name plus a list of devices as arguments and upgrades the OS sitting on the devices' flash. The script has been tested on: Supervisor II in Catalyst 5x0x
upgrade-catos takes an image file name plus a list of devices as arguments and upgrades the OS sitting on the devices' flash. The script has been tested on: Catalyst 400x, Catalyst 650x (Sup 1A and Sup2)
upgrade-ios takes an image file name plus a list of devices as arguments and upgrades the OS sitting on the devices' flash. The script has been tested on: MSFC1, MSFC2, C5KRSM, cat650x, cisco2620, cisco3640, cisco7206VXR
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.
pinger-report pings a major network, maintaining an ASCII database of addresses which have answered pings and produces two reports, one of which lists every address in the hosts table which has answered a ping and another which summarizes IP address utilization by subnet. Run it from cron every hour or two.
porter-report takes a list of devices as arguments and asks that device for ifInOctets on every interface. It stores the result in an ASCII database, watches for changes, and produces a text report listing ports which haven't seen ifInOctets increment in the last 30 days. It also produces a report which summarizes port utilization by switch. If a given interface's ifInOctets count has not incremented for 30 days, then that port appears in the 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.
reset-device takes a list of devices as arguments and reboots them.
These scripts query a list of devices and build MRTG config files.
build_host_config queries a list of boxes running the Net-SNMP daemon or the Microsoft SNMP service.
build_router_config queries a list of Cisco routers (devices running the Cisco IOS).
build_switch_config queries a list of Cisco Catalyst devices (devices running the CatOS) for the single variable of backplane utilization.
build_temperature_config queries a list of American Power Conversion Web/SNMP cards for the single variable of temperature.
build_ups_config queries a list of American Power Conversion Web/SNMP cards for UPS-related variables.
build_wap_client_config queries a list of Cisco Aironet devices (wireless access points) for the single variable of 'currently associated clients'.
build_wap_rf_int_config queries a list of Cisco Aironet devices (wireless access points) for the single variable of 'radio frequency interface utilization' (ifInOctet/ifOutOctet).
To install these scripts, perform the following steps:
Poke around www.skendric.com for relevant information.
Send me e-mail (find my address on www.skendric.com).