Nagios CRC Check for Cisco devices

Check Cisco devices to see if the CRC error rate is increasing.

  • In the Cisco device, determine which interface you want to monitor: show int desc
  • Find the ifindex number for the interface: show snmp mib ifmib ifindex

This script requires a place to keep temp files for the current CRC values. Put your path for the temp directory in CRCFILE. In CRCINCRNUM put the number that would constitute a critical increase of CRCs in a 24 hour period.

In commands.cfg:

define command{ 
  command_name    check_crc_increase
  command_line    $USER1$/check_crc_increase $HOSTADDRESS$ $ARG1$ $ARG2$
}

In services.cfg:

check_command                   check_crc_increase!!

Variables:

CRCFILE=/data1/nagios/tmp/crc\_${1}.${2}.increase
LASTVAL=$(cat ${CRCFILE} | awk '{print $1}')
CURRENTVAL=$(snmpget -v1 -Cf -c ${3} ${1} 1.3.6.1.4.1.9.2.2.1.1.12.${2} | awk '{print $NF}')
CRCTIMES=$(cat ${CRCFILE} | awk '{print $2}')
CRCINCR=$(($CRCTIMES+1))
CRCINCRNUM=10000