Difference between revisions of "C309a"
Jump to navigation
Jump to search
(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...") |
|||
Line 1: | Line 1: | ||
==HP C309a Printer Plugins== | ==HP C309a Printer Plugins== | ||
+ | The following plugins report ink and pages printed statistics. | ||
+ | |||
+ | === HP C309a Printer Ink Level Plugins === | ||
+ | |||
+ | This plugin reports the remaining ink level on an HP C309a printer. The text listing below can be saved into a file named c309_ink_ and then a link can be created from its location into your munin plugins directory. The plugin link name must have the printer IP address or DNS name appended to the plugin name, as shown below. | ||
+ | |||
+ | $ ln -s /path/to/c309_ink_ /etc/munin/plugins/c309_ink_192.168.1.7 | ||
+ | |||
+ | or: | ||
+ | |||
+ | $ ln -s /path/to/c309_ink_ /etc/munin/plugins/c309_ink_printer | ||
+ | |||
+ | |||
+ | where printer is your DNS name for your printer. | ||
+ | |||
+ | |||
+ | You may also need to promote the plugin to run as root if your net-tools snmpget binary is not available to normal users. | ||
+ | |||
+ | '''/etc/munin/plugin-conf.d/munin-node''' | ||
+ | |||
+ | <pre> | ||
+ | [c309*] | ||
+ | user root | ||
+ | </pre> | ||
− | |||
<pre> | <pre> |
Revision as of 14:03, 20 January 2013
HP C309a Printer Plugins
The following plugins report ink and pages printed statistics.
HP C309a Printer Ink Level Plugins
This plugin reports the remaining ink level on an HP C309a printer. The text listing below can be saved into a file named c309_ink_ and then a link can be created from its location into your munin plugins directory. The plugin link name must have the printer IP address or DNS name appended to the plugin name, as shown below.
$ ln -s /path/to/c309_ink_ /etc/munin/plugins/c309_ink_192.168.1.7
or:
$ ln -s /path/to/c309_ink_ /etc/munin/plugins/c309_ink_printer
where printer is your DNS name for your printer.
You may also need to promote the plugin to run as root if your net-tools snmpget binary is not available to normal users.
/etc/munin/plugin-conf.d/munin-node
[c309*] user root
#!/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}'