Line 87: |
Line 87: |
| /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}' | | /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> |
| + | |
| + | |
| + | === HP C309a Pages Processed Plugins === |
| + | |
| + | This plugin reports statistics relating to the number of pages processed on an HP C309a printer. The text listing below can be saved into a file named c309_pages_ 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_pages_ /etc/munin/plugins/c309_pages_192.168.1.7 |
| + | |
| + | or: |
| + | |
| + | $ ln -s /path/to/c309_pages_ /etc/munin/plugins/c309_pages_hp309 |
| + | |
| + | |
| + | where 192.168.1.7 is your printer IP address, or else hp309 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> |
| + | #!/bin/sh |
| + | # |
| + | # Plugin to report printer page count. |
| + | # |
| + | # Contributed by Tim Chappell |
| + | # |
| + | # Magic markers - optional - used by installation scripts and |
| + | # munin-config: |
| + | # |
| + | #%# family=manual |
| + | #%# capabilities=autoconf |
| + | |
| + | IP=${0##*/c309_pages_} |
| + | |
| + | if [ "$1" = "autoconf" ]; then |
| + | echo yes |
| + | exit 0 |
| + | fi |
| + | |
| + | if [ "$1" = "config" ]; then |
| + | |
| + | echo 'graph_category printing' |
| + | echo 'graph_title Printer Page Count' |
| + | # echo 'graph_args --base 1000 -l 0 ' |
| + | echo 'graph_args --base 1000' |
| + | echo 'graph_vlabel Pages (number)' |
| + | echo 'pages.label Pages' |
| + | echo 'pages.draw LINE1' |
| + | exit 0 |
| + | fi |
| + | |
| + | /usr/bin/snmpget -c public -v 1 $IP SNMPv2-SMI::mib-2.43.10.2.1.4.1.1 | awk '{printf "pages.value %s\n",$NF}' |
| </pre> | | </pre> |