Dale's relatively small collection of potentially useful scripts somewhat
related to Network and System Administration one way or another

Maintained by: Dale W. Carder
Network Engineer
University of Wisconsin at Madison
Contact info can be found back on Dale's UW homepage

This is a list of some cruddy scripts we have written lately to aid us in our work. Use them, or pilfer code from them to use as
a base to make your own better tools. Feel free to contact or flame me about them, send in patches, fix my bugs, whatever.

All scripts are released under terms of the original license holder's terms or if not otherwise stated, released
under terms of the Artistic License 2.0 and Copyright 2012 The University of Wisconsin Board of Regents.



ApplicationScriptDescription
Python library for OpenDaylight OpenDaylight.py Now on github.
Captive Portal for network authorization Captivator-gw A very robust, linux-based captive portal implementation in use by the University of Wisconsin. Works inline at layer 2 (like a bump in the wire). More information about its wide range of features can be found here.
A Second attempt at threshold monitoring for RRD data sets process_rrd2.pl

usage notes
RRD files are used by tons of folks to create pretty graphs that very often nobody looks at. So, why not let a program look at the data and alert you when a threshold is crossed? Configure your monitoring application of choice (like MRTG) to store it's backend data in RRD files which this tool, run via cron, parses through and reports threshold violations. This is very useful for monitoring bandwidth utilization, error counters, cpu usage, etc.
A First attempt at threshold monitoring for RRD data sets process_rrd.pl

usage notes
This one might be easier to use.
Visualize an RRD data set as a histogram instead of time-series. genhistogram.pl Why not. See here for an example. Uses GNUPlot to do the dirty work.
Scraping ARP and ND tables off of IOS devices physaddrwatch_ipv4.pl
physaddrwatch_ipv6.pl
This script shells out (yuck!) to clogin (from RANCID) to run "show ip arp" on each IOS router and shoves this into an SQL table. The reason for using the IOS CLI instead of SNMP is due to incredibly high cpu usage on routers with tens of thousands of arp entries. SNMP requires lexiographical ordering of the entries in the table. This causes the router CPU's to sort these tens of thousands of entries and and the polling often can take minutes or worse. The CLI output is not in any particular order (well, maybe the order the software got it from the hardware), and is much quicker to poll. The CPU load on our busiest routers thus has been reduced dramaticly.
Cisco Catalyst 6500/7600 MRTG SNMP target builder gen6500targets.pl
gen6500htmlpage.pl
Figuring out how to monitor 6500/7600's via snmp can be challenging, especially for items like processor utilization (the switch processor, route processor, optional DFC's). Also challenging is some interfaces types (like real ports) support a set of variables, and some interfaces (like SVI, or vlan interfaces) support a different set of variables. So this script pokes the router for what it is willing to answer, and puts that in the MRTG target file output.
Cisco PIX and Firewall Services Module (FWSM) MRTG SNMP target builder genFWSMtargets.pl
genFWSMhtmlpage.pl
Simple scripts to produce a MRTG target file and a static web page for FWSM contexts or a PIX.
Cisco IOS configuration parsing tools ifgrep
sgrep

By: Elle Janet Plato
Address match functionality in sgrep by Dale W. Carder

ifgrep is a quckie tool to 'grep' for an interface's configuration in an IOS configuration file format. ex: ./ifgrep 'FastEthernet0/2' router-1.cfg

sgrep is a stanza grep tool, which is a more general interface into searching through IOS configurations (or any file that has a 'stanza'-like format). sgrep also can match ip addresses, and even match ip addresses inside a subnet.
ex1: ./sgrep 'router ospf 10' router-2.cfg
ex2: ./sgrep '192.168.1.120' router-3.cfg

Convert CatOS 8 configs into IOS 12.2 catcfg.tar.gz
catcfg-readme.txt

By: Elle Janet Plato.
License: GPL

When we converted from "hybrid" CatOS 8 to "native" IOS 12.2 on the 6500 platform, we wrote this tool to convert the configuration for us. Also contains a nice library for parsing CatOS configurations. We wish to thank Cisco Systems, Inc for the donation of the original source code upon which this program is based to be released under the GPL.
Execute UNIX processes in parallel By Bryan Dongray original available here

My patch (possibly for an older version) or
my version: parallel.pl
A problem came about that processing log files from our firewalls was taking too long to complete as a batch job run via cron. Since we have a SMP machine, if we can generate the reports in parallel on different processors, the reports can be made much faster. I took Bryan Dongray's excellent parallel.pl, and modified it to run commands listed on STDIN.

Update 2008-12-16, Bryan updated his tool to incorporate this feature via the exec command, ex: ... | parallel $N exec

Multicast troubleshooting tool By John Kristoff origional available here

My patch or
my version: mcastsum.pl
Mcastsum is a great tool to grab snmp counters useful in troubleshooting multicast issues like igmp joins and leaves, routes, and packet counters. I modifed John's version to produce a smaller and more digestable tabular output.


$Id: index.html,v 1.5 2010-12-08 11:18:02-06 dwcarder Exp dwcarder $