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

molnarmate

Reviews(1)
bymolnarmate, March 28, 2012
SNMP Printer Check
I wrote a little change in check_page_count function:

function check_page_count(){
local PAGE_EXIT_CODE=0
PAGE_COUNT=$(snmpget -v1 -Ovq -c $COMMUNITY $HOST_NAME 1.3.6.1.2.1.43.10.2.1.4.1.1 2>/dev/null)

if [ "$PAGE_COUNT" -lt "$WARNING" ]; then
EXIT_STRING="Pagecount is $PAGE_COUNT - OK!$SEPARATOR"
else
if [ "$PAGE_COUNT" -ge "$WARNING" ] && [ "$PAGE_COUNT" -lt "$CRITICAL" ]; then
EXIT_STRING="Pagecount is $PAGE_COUNT - WARNING!$SEPARATOR"
PAGE_EXIT_CODE=1
else
if [ "$PAGE_COUNT" -ge "$CRITICAL" ]; then
EXIT_STRING="Pagecount is $PAGE_COUNT - CRITICAL!$SEPARATOR"
PAGE_EXIT_CODE=2
fi
fi
fi

PERFDAT="Pages;Warning;Critical=$PAGE_COUNT;$WARNING;$CRITICAL;"
return $PAGE_EXIT_CODE

}