質問

I need to retrieve the HP printer information from the SNMP HP printer jetleg agent. I'm able to retrieve the printer counter with this snmpget command:

snmpwalk -v1 -c public 10.0.0.110 mib-2.43.10.2.1.4.1.1 
SNMPv2-SMI::mib-2.43.10.2.1.4.1.1 = Counter32: 16101

But now I need to get the printer location from the SNMP agent, does anyone have the idea how to do this? Please advise.

役に立ちましたか?

解決 2

1) You can have a great start from here -> Printer SNMP-RFC1759. This is all the important information that SNMP can provide you about you printer.

2) Try using MIB browser software to search for more oid used to retrieve information. Browse in the mib tree, under system mib. All information like Description,upTime,Contact,Name,Location,Services.

3) There's no way you can retrieve the location from jetdirect via SNMP. Description of printer like location is set into the system MIB.

他のヒント

A bit of googling for that OID reveals that it belongs to the MIB module "Printer-MIB", which is published by IETF as RFC 3805. You can read it here: https://www.rfc-editor.org/rfc/rfc3805

It contains a number of interesting variables about a printer, including counters for each "marker" in the printer, as you've noticed. On a laser printer, the counter unit is likely to be "impressions printed", but do take care to check the value of .1.3.6.1.2.1.43.10.2.1.3.1.1 as well, as that defines the unit of counting. Either of the below are valid units!

3=tenThousandthsOfInches(3)
4=micrometers(4)
5=characters(5)
6=lines(6)
7=impressions(7)
8=sheets(8)
9=dotRow(9)
11=hours(11)
16=feet(16)
17=meters(17)

If you're looking for remaining amount of toner/ink, check instead the prtMarkerSuppliesTable, particularly prtMarkerSuppliesLevel, .1.3.6.1.2.1.43.11.1.1.9.

Now, location is a variable which does not appear in the Printer-MIB. You'd probably be better off looking in the SNMPv2-MIB, at the variable .1.3.6.1.2.1.1.6 (sysLocation).

"The physical location of this node (e.g., 'telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string."

Of course, this variable will only be set if

  1. HP decided to implement the SNMPv2-MIB in their printers (which is likely, though I have no chance to check)
  2. The person installing the printer took the time to set the value of sysLocation to something useful. This would usually be done on the printer's front panel, but might also be set over SNMP.

Update: Try doing a full SNMP walk. That is, retrieve all the variables of the MIB.

snmpwalk -v1 -Ont -c public 10.0.0.110 

(The -Ont flag disables the MIB name interpretation and gives you numeric OIDs in the output.)

It should then be easy to find the variable .1.3.6.1.2.1.1.6. It will have the .0 instance OID appended to it, indicating it's a scalar value, so it will actually look like ".1.3.6.1.2.1.1.6.0 = 4th floor printer room"

If the output is large, try using grep if you have it.

Again, if it isn't set to anything useful, you'll have to set it (or have the printer staff set it). Check the printer's manual, or contact HP support for details on how to set the variable persistently, if you can't figure it out.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top