BUG: Printer Supply Check for Toner Levels incorrect interpretation of description

Hi there,

I have been using Check_MK for a while and we have just upgraded from 1.4.0p38 to 1.6.0p20 but we have seen that our printer Tonner is no longer being tracked correctly.

As from 1.4.0 below, we can see the level of the toner

In 1.6.0 we no longer can see it and get a detailed graph on it.

Is there something I can change to make this work in 1.6.0?

Any help would be grateful.

Thanks

Ian

If you do a discovery on this host you get no different toner check shown?

On the command line as site user you can do a “cmk --debug -vvII hostname” and see what is found directly.

Hi Andreas,

Just so you can see what the new version show I have put it below:

As to all the debug information I have put it on the link: https://pastebin.pl/view/c5d1c6c9

I hope it helps to understand what I am on about in my original post.

Regards

Ian

Ok the black cartridge itself is there but the check gives no good output with only the “OK - [black…”
This you can test on the command line with “cmk --debug --checks=printer_supply -vvn hostname”

Or you can inspect the raw data from the printer with snmpbulkwalk -Cr10 -v2c -c public -m "" -M "" -Cc -OQ -OU -On -Ot 10.0.0.207 .1.3.6.1.2.1.43.11.1.1

Thanks for getting back so quick.

I can see by running the cmk --debug --checks=printer_supply -vvn with this printer is does give the correct information but not on the web page:

Supply ADF Pickup Roller HP Z7Y64A OK - 99% (warn/crit at 10% / 5%)
Supply ADF Separation Roller HP Z7Y66A OK - 97% (warn/crit at 10% / 5%)
Supply Black Cartridge HP W9014MC OK - 46% (warn/crit at 10% / 5%)
Supply Black Developer Unit HP Z8W52A OK - 63% (warn/crit at 10% / 5%)
Supply Black Drum HP W9015MC OK - 99% (warn/crit at 10% / 5%)
Supply Fuser Kit HP 110V-Z7Y75A 220V-Z7Y76A OK - 46% (warn/crit at 10% / 5%)

Is there something I have to change to make the output correct?

No the output is normally only a text field and i don’t see any printable special characters in your output.
It looks like there is something special in the output between “Black” and “Cartridge”.
The snmpwalk can give a little bit more information.
It is important if you see there more than one space between theses two words.

Sorry for reply a lot on this I have done the SNMP walk that you said about before and uploaded it here:

If there any more information you would require to help me fix it let me know what to do.

The temp fix me did was to copy the printer_supply from 1.4.0p38 and put it over to get it to display but would like to use the new version of the software.

The output looks ok. I don’t know why it breaks behind the “Black” from the cartridge check.
This must be a bug in the parse function of the “printer_supply” check.

EDIT: i changed the topic to “BUG: …”

Hello @Iancomline,

we stumbled across the same problem with our 1.6.0p18 sites. In our case we had this broken output for all cartridges on the printers.
It seems that the problem is a non printable character in the value of the OID which is used for the color of the cartridge.
The check has two possible OIDs from which it pulls the name for the color of the cartridge. In our case the SNMPwalk for these OIDs looked like this:

.1.3.6.1.2.1.43.12.1.1.4.1.1 "62 6C 61 63 6B 00 " → black
.1.3.6.1.2.1.43.12.1.1.4.1.2 "63 79 61 6E 00 " → cyan
.1.3.6.1.2.1.43.12.1.1.4.1.3 "6D 61 67 65 6E 74 61 00 " → magenta
.1.3.6.1.2.1.43.12.1.1.4.1.4 "79 65 6C 6C 6F 77 00 " → yellow

As you can see the printer sends the names in hex and checkmk is converting it on the server side to “human readable” text. However, you can see that all these values end with 00 which when interpreted as hex is the representation for the NULL-byte and that is a non printable character. This apparently breaks the output in the webinterface, it curioulsy is not a problem for the output on the commandline.

Our temporary fix was to copy the printer_supply-check from ~/share/check_mk/checks/printer_supply to the local-hierarchy ~/local/share/check_mk/checks/printer_supply and add one line (line 152) to strip the NULL-byte from the end of corresponding string:

150             color_info = ""
151             if color and color.lower() not in item.lower():
152                 color = color.rstrip('\0')
153                 color_info = "[%s] " % color

After this change the check on the webinterface shows the full output and the performace-data again.

I assume this bug was somehow introduced in this commit: 11277 FIX Fix wrong allocation of colorant for printer supplies · Checkmk/checkmk@934e48c · GitHub

Hope this helps!

Cheers,
Lorenz

1 Like

Just FYI: There is now a Werk regarding this issue, so this should be fixed in 2.0.0p4: <tt>printer_supply</tt>: handle trailing null bytes in prtMarkerColorantValue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.