simple snmp counter script

Categories: Linux, Script

this is a simple little script to count the errors and other things out put over snmp during the course of one minute.

i didnt leave the output portion of this script on the bottom of it since i was using it for a couple of different things.

#!/bin/bash -x

# count is a "counter" for snmp objects of type count

case $1 in


      # to check errors - try oid "ifInErrors.x" & ifOutErrors.x"
      SNMP_IN=`snmpwalk -v 1 -c svipoll -Oqv <ip address> ifInOctets.1`
      echo "Echoing total number of counts from the last minute"
      echo "$SNMPSUB in the last minute"
      echo $SNMP_IN > $COUNT_IN

    *) echo "<count|bw>, vi $0 to see it work"

    Leave a Reply

    Your email address will not be published. Required fields are marked *