#!/bin/sh SNMPDIR=/var/log/logstory/snmp QUIET= COMM=xxx if [ "$1" = "--quiet" ] ; then QUIET=on shift fi if [ "$1" = "--all" ] ; then if [ ! -x /root/logstory-listswitches ] ; then echo Script /root/logstory-listswitches do not exist echo Please create one which lists all switches to probe exit 1 else SWITCHES=`/root/logstory-listswitches` fi elif [ "$1" = "" ] ; then echo logstory-scanswitches --all echo logstory-scanswitches switch ... exit 1 else SWITCHES="$*" fi mkdir -p $SNMPDIR for sw in $SWITCHES do if [ "$QUIET" = "" ] ; then echo $sw fi smpbulkwalk -u $COMM -c public $sw >$SNMPDIR/$sw.snmp done