mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 18:07:20 +00:00
Initial version
This commit is contained in:
parent
5a1851405a
commit
2495adf983
1 changed files with 59 additions and 0 deletions
59
plugins/other/snmp_hplj2015
Executable file
59
plugins/other/snmp_hplj2015
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOST=${host:-"127.0.0.1"}
|
||||
|
||||
: << =cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
snmp_HPLJ2015 - Consumables level on HP LaserJet 2015n reported over SNMP
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
HOST
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Oleksiy Kochkin
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
As is.
|
||||
|
||||
=back
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=contrib
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=cut
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
|
||||
echo "graph_title Consumables level @ $HOST"
|
||||
echo 'graph_args --upper-limit 100 -l 0'
|
||||
echo 'graph_vlabel %'
|
||||
echo 'graph_category printers'
|
||||
echo 'graph_scale no'
|
||||
echo 'black.label Black toner level'
|
||||
echo 'black.draw LINE2'
|
||||
echo 'black.type GAUGE'
|
||||
echo 'black.colour 000000'
|
||||
echo 'black.warning 5:'
|
||||
echo 'black.critical 1:'
|
||||
echo 'black.min 0'
|
||||
echo 'black.max 100'
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
BLACK_MAX_OID=".1.3.6.1.2.1.43.11.1.1.8.1.1"
|
||||
BLACK_LVL_OID=".1.3.6.1.2.1.43.11.1.1.9.1.1"
|
||||
|
||||
BLACK_MAX=`snmpget -v 1 -c public -Ov -Oq $HOST $BLACK_MAX_OID`
|
||||
BLACK_LVL=`snmpget -v 1 -c public -Ov -Oq $HOST $BLACK_LVL_OID`
|
||||
BLACK_LVL_PERCENTS=$(($BLACK_LVL*100/$BLACK_MAX))
|
||||
|
||||
echo -n "black.value "
|
||||
echo $BLACK_LVL_PERCENTS
|
Loading…
Add table
Add a link
Reference in a new issue