Closed fma-bk closed 3 years ago
Give this patch a whirl. I found an old brother printer I had lying around to help assist with some of the OIDs. This should work as you would want it to. Let me know!
check_snmp_printer-brother-patch.txt
patch check_snmp_printer < check_snmp_printer-brother-patch.txt
Good Morning :)
Works well, expect two things:
I attached a (very poorly painted ;) ) image with the output of the plugin and an screenshot of the printers web page toner status.
Oops. Can you apply this patch and let me know. Thanks!
Note this isn't probably 100% perfect, but should work in most scenarios.
check_snmp_printer-brother-patch2.txt
patch check_snmp_printer < check_snmp_printer-brother-patch2.txt
Did that patch work out for you?
Hi, The missing Space is fixed. But the Toner Level is still on 100% althoug yellow is nearly empty. We are still looking into to to see if the problem is with snmp/icinga/the Plugin...
Ok, its the Plugin. I think you can only get the Toner Levels from the Error Warnings. Maybe "bigger" Brother Printers will deliver more accurate results over snmp... What about the sollution i mentioned in the brother-snmpwalk.txt at the end? if [ -z $ALERTDESCR ]; then EXIT_STRING="UNKNOWN - could not get values for toner level. \n" EXIT_CODE=3 elif [[ ! $ALERTDESCR =~ "WENIG TONER" ]] && [[ ! $ALERTDESCR =~ "TONER ERSETZEN" ]]; then EXIT_STRING="OK - toner level is ok. \n" EXIT_CODE=0 elif [[ $ALERTDESCR =~ "WENIG TONER" ]]; then EXIT_STRING="WARNING - toner low. \n" EXIT_CODE=1 elif [[ $ALERTDESCR =~ "TONER ERSETZEN" ]]; then EXIT_STRING="CRITICAL - toner empty! \n" EXIT_CODE=2 else EXIT_STRING="UNKNOWN - please check script. \n" EXIT_CODE=3 fi
My code was supposed to fallback to the alert messages if the brother's OID specific levels weren't there. I'm testing with a small MFC-7840W but it's only B&W and the only one I have available. My concern about the alert messages is it sounds pretty generic. It doesn't seem to specify which toner is low or empty.
I think I found the issue - the current capacity OID is reporting -3 which is supposed to mean that the printer knows that there is some supply/remaining space. It looks like even if it's low it will report a -3. Let me look to find a solution around this.
Are all the toners showing "levels are OK" messages or are you actually seeing a % message after the last patch?
I might only be able to report on empty or something there and then you'd have to fall back to the --messages switch which I can change the plugin to report as warning/critical depending on messaging.
It reports all "OK" and no %. In the picture in my 2nd posting you can see the actual levels. It reports Yellow Low(DE Niedrig). I dont think it will give you % values via snmp... And sorry for my late reply...
Sorry for delay.
That is the way that Brother will be reporting unfortunately. They don't provide % information for older models and possibly current models. It only reports on "Yes I have something remaining" (could be even 1% left but it still has something) or "Nope, I'm empty" so there's no in between. Because of this I modified the -messages output to go warning/critical depending on specific messages so that can be used in unison with the consumables.
Grab the new update below. I'm going to mark this as closed but if there's any bug you notice with the below code please open another issue and I'll look into it. Thanks!
https://github.com/Tylan/check_snmp_printer/blob/master/check_snmp_printer
Hi, and here are the oids from our Brother Printer. brother-snmpwalk.txt