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!!


LASTVAL=$(cat ${CRCFILE} | awk '{print $1}')
CURRENTVAL=$(snmpget -v1 -Cf -c ${3} ${1}${2} | awk '{print $NF}')
CRCTIMES=$(cat ${CRCFILE} | awk '{print $2}')