Changes

Jump to navigation Jump to search
2,132 bytes added ,  13:53, 20 January 2013
Created page with "==HP C309a Printer Plugins== This plugin reports the remaining ink level on an HP C309a printer. <pre> #!/bin/sh # # Plugin to measure remaining ink level on an HP C309 ser..."
==HP C309a Printer Plugins==

This plugin reports the remaining ink level on an HP C309a printer.

<pre>

#!/bin/sh
#
# Plugin to measure remaining ink level on an HP C309 series device.
#
# Contributed by Tim Chappell
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=manual
#%# capabilities=autoconf

IP=${0##*/c309_ink_}

if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi

if [ "$1" = "config" ]; then

echo 'graph_category printing'
echo 'graph_title Printer Ink Level'
echo 'graph_args --upper-limit 100 -l 0 '
echo 'graph_vlabel Remaining level (%)'
echo 'black.label Black ink'
echo 'black.draw LINE1'
echo 'black.warning 20:'
echo 'black.critical 10:'
echo 'black.colour 000000'
echo 'yellow.label Yellow ink'
echo 'yellow.draw LINE1'
echo 'yellow.warning 20:'
echo 'yellow.critical 10:'
echo 'yellow.colour ffff00'
echo 'cyan.label Cyan ink'
echo 'cyan.draw LINE1'
echo 'cyan.warning 20:'
echo 'cyan.critical 10:'
echo 'cyan.colour 00ffff'
echo 'magenta.label Magenta ink'
echo 'magenta.draw LINE1'
echo 'magenta.warning 20:'
echo 'magenta.critical 10:'
echo 'magenta.colour ff00ff'
echo 'lightblack.label Photoblack ink'
echo 'lightblack.draw LINE1'
echo 'lightblack.warning 20:'
echo 'lightblack.critical 10:'
echo 'lightblack.colour 808080'
exit 0
fi

/usr/bin/snmpget -c public -v 1 $IP SNMPv2-SMI::mib-2.43.11.1.1.9.1.1 | awk '{printf "black.value %s\n",$NF}'
/usr/bin/snmpget -c public -v 1 $IP SNMPv2-SMI::mib-2.43.11.1.1.9.1.2 | awk '{printf "yellow.value %s\n",$NF}'
/usr/bin/snmpget -c public -v 1 $IP SNMPv2-SMI::mib-2.43.11.1.1.9.1.3 | awk '{printf "cyan.value %s\n",$NF}'
/usr/bin/snmpget -c public -v 1 $IP SNMPv2-SMI::mib-2.43.11.1.1.9.1.4 | awk '{printf "magenta.value %s\n",$NF}'
/usr/bin/snmpget -c public -v 1 $IP SNMPv2-SMI::mib-2.43.11.1.1.9.1.5 | awk '{printf "lightblack.value %s\n",$NF}'

</pre>

Navigation menu