Using Nagios to Watch PRI Usage

Here is a really quick (and even dirtier) way to quickly determine if you are overextending your PRI usage.

This is a really simple script for Nagios to run and report how many concurrent calls you have.

Fill in the blanks for NAMEOFHOST (CallManager hostname), COMMUNITYNAME (snmp read only community name for CallManager Express) and ifnums. ifnums are the integer values for IF-MIB::ifIndex.** where ** is the interface number for your PRI. you will have to do some snmpwalking to figure this out. I left some values in the script to show how to format your entries.

This script requires the check_ifoperstatus Nagios plugin to work. I will clean this up soon and re-post.

This script throws a critical warning if the PRI usage is 7 or more concurrent calls

#!/bin/sh
# SNMP test for number of interfaces up in a particular range
export NAG_PLUG_PATH=/usr/lib/nagios/plugins
export IF_STAT_PLUG=check_ifoperstatus
export NAMEOFHOST=_____________
export COMMUNITY_NAME=____________
ifnums=( 23 24 25 26 27 28 29 30 31 32 )
CTR1=0
for interface in ${ifnums[@]} do   
  VAR1=`$NAG_PLUG_PATH/$IF_STAT_PLUG -k $interface -H $NAMEOFHOST -C $COMMUNITY_NAME`
  if [ "${VAR1%*\:*\:*}" = "CRITICAL" ]; then
    VAR2=0
  else
    CTR1=`expr $CTR1 + 1`
  fi
done
if [ "$CTR1" -ge "7" ]; then
  STATUSCODE=CRITICAL
else
  STATUSCODE=OK
fi
echo "PRI $STATUSCODE - $CTR1 calls currently"