Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Directory

Schillo

Reviews(1)
bySchillo, October 8, 2010
1 of 1 people found this review helpful
SNMP Printer Check
Great Plugin.
I added 3 little Functions - maybe you wanne add them to the Script:
Display Message
Printer Status
Device Status

#################################################
#########################################################
### check_display function ###
#########################################################
function check_display(){
DISPLAY=`snmpget -v1 -On -c $COMMUNITY $HOSTNAME 1.3.6.1.2.1.43.16.5.1.2.1.1 | cut -d " " -f4-`

printf "Displaytext: $DISPLAY
"
exit 0
}
#########################################################
### check_printer_status function ###
#########################################################
function check_printer_status(){
PRSTATUS=`snmpget -v1 -On -c $COMMUNITY $HOSTNAME 1.3.6.1.2.1.25.3.5.1.1.1 | cut -d " " -f4-`
EXITSTRING="Drucker Status = "
EXITCODE=0
case "$PRSTATUS" in
"other(1)")
EXITSTRING="$EXITSTRING$PRSTATUS - STATUS: CRITICAL!"
EXITCODE=2
;;
"idle(3)")
EXITSTRING="$EXITSTRING$PRSTATUS - STATUS: OK!"
EXITCODE=0
;;
"printing(4)")
EXITSTRING="$EXITSTRING$PRSTATUS - STATUS: OK!"
EXITCODE=0
;;
"warmup(5)")
EXITSTRING="$EXITSTRING$PRSTATUS - STATUS: OK!"
EXITCODE=0
;;
*)
EXITSTRING="$EXITSTRING$PRSTATUS - STATUS: WARNING!"
EXITCODE=1
;;
esac
printf "$EXITSTRING|$PRSTATUS;;;
"
exit $EXITCODE
}
#########################################################
### check_device_status function ###
#########################################################
function check_device_status(){
DEVSTATUS=`snmpget -v1 -On -c $COMMUNITY $HOSTNAME 1.3.6.1.2.1.25.3.2.1.5.1 | cut -d " " -f4-`

EXITSTRING = "Geraet Status = "
EXITCODE=0
case "$DEVSTATUS" in
"unknown(1)")
EXITSTRING="$EXITSTRING$DEVSTATUS - STATUS: WARNING!"
EXITCODE=1
;;
"running(2)")
EXITSTRING="$EXITSTRING$DEVSTATUS - STATUS: OK!"
EXITCODE=0
;;
"warning(3)")
EXITSTRING="$EXITSTRING$DEVSTATUS - STATUS: WARNING!"
EXITCODE=1
;;
"testing(4)")
EXITSTRING="$EXITSTRING$DEVSTATUS - STATUS: OK!"
EXITCODE=0
;;
"down(5)")
EXITSTRING="$EXITSTRING$DEVSTATUS - STATUS: CRITICAL!"
EXITCODE=2
;;
*)
EXITSTRING="$EXITSTRING$DEVSTATUS - STATUS: WARNING!"
EXITCODE=1
;;
esac
printf "$EXITSTRING|$DEVSTATUS;;;
"
exit $EXITCODE
}