SNMP: generic OID for printed page count

19,646

This is not really a programming question, but since you're developing an application, I guess it sort of fits on Stack Overflow anyway...

1.3.6.1.2.1.43.10.2 is a table, prtMarkerTable.

1.3.6.1.2.1.43.10.2.1.4 is the column prtMarkerLifeCount. It counts the marker, and on a laser printer, I would expect it to count pages printed.

If you have a color laser printer, it might count each cartridge as a separate "marker", so you'd have multiple rows in the table. This is up to the printer vendor. If that's the case, you could see the value for each marker by doing an SNMP walk of the whole table. Using the net-snmp command line tools, the command line would be something like

snmpwalk -c public -v2c <printer-address> 1.3.6.1.2.1.43.10.2

The output might give you some insight into what your particular printer publishes.

You can see the different OIDs of the MIB for instance at this web page, and you can read the whole MIB in RFC 3805.

Note that while most printer vendors implement RFC 3805, it's not mandatory, so you should check each new printer that arrives for compliance. Some vendors might prefer to implement a proprietary printer MIB.

Share:
19,646
Dylan Reniers
Author by

Dylan Reniers

Updated on June 14, 2022

Comments

  • Dylan Reniers
    Dylan Reniers almost 2 years

    I'm currently in the middle of developing an application that involves getting data from printers by the SNMP protocol. Since I'd like to program to be as generic as possible, I try to use the same OID's as much as I can for different types of printers. I was hoping to find an OID that would tell me how many pages were printed in color and black. I know the OID 1.3.6.1.2.1.43.10.2.1.4.1.1 gives you a total, but I really need to have a difference in color and black/white for statistical purposes

    If there is an OID which could tell me how many pages there were printed in color/black and white and it can be used on different models/types of printers, and you happen to know it, please don't hesitate to fill me in.

    Kind regards

  • Dylan Reniers
    Dylan Reniers almost 10 years
    The OID you gave me is the one I give in my question post. As I said before, it only gives you the total amount of the printed pages.
  • Jolta
    Jolta almost 10 years
    I was not trying to give you a new OID. I was trying to come up with ideas for how you could use the OID you gave. Shall I take it that the table only has one column on your printer?
  • Dylan Reniers
    Dylan Reniers almost 10 years
    Indeed, it only gives 1 value, regardless of which printer it is. I've tried this OID with Canon, Brother, Kyocera and HP, each time it's only 1 result
  • Jolta
    Jolta almost 10 years
    Oh, I guess "marker" is the component that applies the toner. You'd only have one in a laser printer. How about the other tables in the PRINTER-MIB? Try prtMarkerSuppliesTable (1.3.6.1.2.1.43.11.1), for instance.