DJ6840

From timswiki
Jump to: navigation, search

Munin plugins for the HP Deskjet DJ6840 printer which report remaining ink levels and number of printed pages.

dj6840_ink_

This plugin performs an SNMP query to the specified printer and reports the remaining black and colour ink levels. The plugin should be saved with a filename 'dj6840_ink_' and a link can then be generated in the munin plugins directory:

 ln -s /path/dj6840_ink_ /etc/munin/plugins/dj6840_ink_192.168.3.7

or:

 ln -s /path/dj6840_ink_ /etc/munin/plugins/dj6840_ink_printer

assuming that 'printer' will resolve in your DNS to the required devices IP.


 #!/bin/sh
 #
 # Plugin to measure remaining ink level on an HP DJ6840 series device.
 #
 # Contributed by Tim Chappell
 #
 # Magic markers - optional - used by installation scripts and
 # munin-config:
 #
 #%# family=manual
 #%# capabilities=autoconf
 IP=${0##*/dj6840_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 'colour.label Colour ink'
       echo 'colour.draw LINE1'
       echo 'colour.warning 20:'
       echo 'colour.critical 10:'
       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 "colour.value %s\n",$NF}'

dj6840_pages_

This plugin performs an SNMP query to the specified printer and reports the number of printed pages. The plugin should be saved with a filename 'dj6840_pages_' and a link can then be generated in the munin plugins directory:

 ln -s /path/dj6840_pages_ /etc/munin/plugins/dj6840_pages_192.168.3.8

or:

 ln -s /path/dj6840_pages_ /etc/munin/plugins/dj6840_pages_djprinter

assuming that 'djprinter' will resolve in your DNS to the required devices IP.


 #!/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##*/dj6840_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_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}'


This website publishes a Privacy Policy. Continued use of this website implies your consent to the use of data outlined in the policy.