I am trying to create a script that once a day will poll 14 printers using snmp to check toner levels. I am using a similar script to grab total pages printed and it works perfectly.
Earmark responded with Kindly use this OID 1.3.6.1.2.1.43.11.1.1.6
.
It just returns the following:
snmpwalk -v 2c -c public 10.###.##.## 1.3.6.1.2.1.43.11.1.1.6
SNMPv2-SMI::mib-2.43.11.1.1.6.1.1 = STRING: "Imaging Unit"
SNMPv2-SMI::mib-2.43.11.1.1.6.1.2 = STRING: "Black Cartridge"
SNMPv2-SMI::mib-2.43.11.1.1.6.1.3 = STRING: "Maintenance Kit"
Any ideas as to how to get an actual value?
0
1.3.6.1.2.1.43.11.1.1.6
corresponds to prtMarkerSuppliesDescription
in the standard Printer-MIB. It’s part of prtMarkerSuppliesEntry
, which includes other rows that can tell you the max capacity of that supply (prtMarkerSuppliesMaxCapacity
), the current level (prtMarkerSuppliesLevel
), and the measurement unit (prtMarkerSuppliesLevel
).
For example, if I query my own printer, here’s what I get:
1.3.6.1.2.1.43.11.1.1.6.1.1: OctetString(b'Black Toner Cartridge')
1.3.6.1.2.1.43.11.1.1.7.1.1: Integer32(13)
1.3.6.1.2.1.43.11.1.1.8.1.1: Integer32(-2)
1.3.6.1.2.1.43.11.1.1.9.1.1: Integer32(-3)
1.3.6.1.2.1.43.11.1.1.6.1.2: OctetString(b'Drum Unit')
1.3.6.1.2.1.43.11.1.1.7.1.2: Integer32(7)
1.3.6.1.2.1.43.11.1.1.8.1.2: Integer32(12000)
1.3.6.1.2.1.43.11.1.1.9.1.2: Integer32(10889)
That first four lines tell me about the “Black Toner Cartridge”. The second line tells me the units, using values from the PrtMarkerSuppliesSupplyUnitTC
enum; the value 13
corresponds to “tenthsOfGrams”. The next line, with a value of -2
, tells that the capacity is unknown, and finally, the -3
on the last line tells me that “the printer knows that there is some supply.”
The second group of four lines tells me about the “Drum Unit”. The capacity and level are given in units of “impressions”, so you can see that the drum unit can print up to 12000 pages, and that it has 10889 remaining.
By the way, if you simply walk prtMarkerSuppliesEntry
, you will get the responses all out of order. You can see in the MIB definition that the INDEX
consists of hrDeviceIndex
and prtMarkerSuppliesIndex
. In other words, the last two numbers in the OID are used to uniquely identify the component that the responses refer to. You should use those numbers to correlate the description with the measurements you want.
1