[Solved] How to alert on toner level?
[Solved] How to alert on toner level?
Hey all, I found the OIDs for the toner levels in several of my printers and I'd like to have Nagios send me an alert when they get down to 5%. I did find a couple of complicated check files on the Nagios Exchange but I just need to see how to alert when a number gets down to a certain value.
Thanks,
Joe B
Thanks,
Joe B
Last edited by jbruyet on Mon May 05, 2014 2:51 pm, edited 1 time in total.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: How to alert on toner level?
What plugin are you going to use to check them? Most checks will have a -w and -c for warning and critical, but they can have different notation for usage.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: How to alert on toner level?
I wasn't sure which plugin to use because every one I've seen so far alerts on incrementing values and I want it to alert on decrementing values; to send an alert when the value drops to 5(%).
Thanks,
Joe B
Thanks,
Joe B
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: How to alert on toner level?
Could you show us a result of an snmpwalk on that printer, and identify the oid you are looking to use?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: How to alert on toner level?
Hi sreinhardt, here are the four OIDs I'm looking at:
The first one is a zero because it's an empty black toner cartridge. This printer sits in dispatch and needs to be available all the time. Another time I caught the low toner in Finance just before I would have been injured -- we're in the middle of an audit.
On an unrelated note, why do some Nagios files look fine in Notepad (yeah, I know) and others need something like Wordpad to display correctly?
Thanks,
Joe B
Code: Select all
SNMPv2-SMI::mib-2.43.11.1.1.9.1.1 = INTEGER: 0
SNMPv2-SMI::mib-2.43.11.1.1.9.1.2 = INTEGER: 68
SNMPv2-SMI::mib-2.43.11.1.1.9.1.3 = INTEGER: 47
SNMPv2-SMI::mib-2.43.11.1.1.9.1.4 = INTEGER: 80On an unrelated note, why do some Nagios files look fine in Notepad (yeah, I know) and others need something like Wordpad to display correctly?
Thanks,
Joe B
- Attachments
-
Disp400.txt- (58.23 KiB) Downloaded 679 times
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: How to alert on toner level?
I got a chuckle out of that one. This is just because of differing line endings. All nagios configs should have unix line endings, which notepad does not respect, but wordpad or notepad++(highly suggested) do.On an unrelated note, why do some Nagios files look fine in Notepad (yeah, I know) and others need something like Wordpad to display correctly?
As for tests on those OIDs, try something like:
Code: Select all
./check_snmp -H [Printer IP] -o SNMPv2-SMI::mib-2.43.11.1.1.9.1.2 -v 2c -C [community string] -w 25: -c 10: -l "[Color] Toner Level" -u "%"Code: Select all
$USER1$/check_snmp -H $HOSTADDRESS$ -o SNMPv2-SMI::mib-2.43.11.1.1.9.1.$ARG1$ -v 2c -C [community string] -w 25: -c 10: -l "$ARG2$ Toner Level" -u "%"
$ARG1 = OID index for specific toner cartridge
$ARG2$ = Color name for label
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: How to alert on toner level?
Thanks sreinhardt, I did the command but I'm getting the critical warning and the toner cartridge is at 66% capacity:
Is there an additional command for decrementing values as opposed to incrementing values? Also, you may notice that I had to drop it back to snmp version v1. Thank you Hewlett-Packard.
Thanks,
Joe B
Code: Select all
root@FreeNag:/usr/home/jobee/SNMP # /usr/local/libexec/nagios/check_snmp -H 192.168.2.78 -o 1.3.6.1.2.1.43.11.1.1.9.1.2 -v 1 -C public -w 25: -c 1
/usr/local/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] 192.168.2.78:161 1.3.6.1.2.1.43.11.1.1.9.1.2
iso.3.6.1.2.1.43.11.1.1.9.1.2 = INTEGER: 66
SNMP CRITICAL - *66* | iso.3.6.1.2.1.43.11.1.1.9.1.2=66
root@FreeNag:/usr/home/jobee/SNMP #Thanks,
Joe B
Re: How to alert on toner level?
You need to change the critical threshold value in your check. Currently it will alert critical for any value over 1. Place a colon after the critical threshold to force it to only trip when under the threshold:
Though, you may want to change it to '2' so you are warned (with a critical notification) when 1% is left instead of 0%:
See the following doc for more details:
https://nagios-plugins.org/doc/guidelines.html
Code: Select all
/usr/local/libexec/nagios/check_snmp -H 192.168.2.78 -o 1.3.6.1.2.1.43.11.1.1.9.1.2 -v 1 -C public -w 25: -c 1:Code: Select all
/usr/local/libexec/nagios/check_snmp -H 192.168.2.78 -o 1.3.6.1.2.1.43.11.1.1.9.1.2 -v 1 -C public -w 25: -c 2:https://nagios-plugins.org/doc/guidelines.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to alert on toner level?
Thank you very much sreinhardt and abrist! I just ran the check from the command line (after correcting my colon typo error) and it worked spectacularly. FWIW, I ran the test on another similar printer and saw that it's down to 5% on one of the toner cartridges.
Thanks again,
Joe B
Thanks again,
Joe B