#!/bin/bash # Start script with # $1 = snmp community # $2 = server IP # $3 = warning value # $4 = ciritical value # # # #snmpget -v 2c -c YOURCOMMUNITY 123.123.123.123 1.3.6.1.4.1.393.200.130.2.2.1.1.8.1 | awk -F " " '{print $4}' . /usr/local/nagios/libexec/utils.sh COMMUNITY=$1 SRV_IP=$2 WARNING=$3 CRITICAL=$4 SMS_MAILQ_MIB="1.3.6.1.4.1.393.200.130.2.2.1.1.8.1" MAILQ=$(snmpget -v 2c -c $COMMUNITY $SRV_IP $SMS_MAILQ_MIB | awk -F " " '{print $4}') #echo $MAILQ echo "Mailq: $MAILQ | Mailq=$MAILQ;$WARNING;$CRITICAL;;" if [ $MAILQ -lt $WARNING ] && [ $MAILQ -lt $CRITICAL ]; then #echo OK exit $STATE_OK elif [ $MAILQ -ge $WARNING ] && [ $MAILQ -lt $CRITICAL ]; then #echo WARN exit $STATE_WARNING else [ $MAILQ -ge $WARNING ] && [ $MAILQ -ge $CRITICAL ] #echo CRIT exit $STATE_CRITICAL fi
This website uses cookies so that we can offer you the best possible user experience. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Kommentare