How to find counters of printers through SNMP

ぐ巨炮叔叔 提交于 2019-12-02 02:52:23

问题


I'm currently working on a project, involving getting information from printers through SNMP. Now the printer I've been testing/working on, is a Lexmark X950.

A problem I've been struggling with, is that I want this program to work for HP or Kyocera or Brother printers aswell, but the OIDs I used only seem to work on Lexmark.

Here are some of the OIDs I used:

<OID type="counter">
    <name>Count total printed</name>
    <OIDN>1.3.6.1.4.1.641.2.1.5.1</OIDN>
</OID>
<OID type="counter">
    <name>count total printed since last boot</name>
    <OIDN>1.3.6.1.2.1.43.10.2.1.5</OIDN>
</OID>
<OID type="counter">
    <name>count total printer black</name>
    <OIDN>1.3.6.1.4.1.641.2.1.5.2</OIDN>
</OID>
<OID type="counter">
    <name>count total printed color</name>
    <OIDN>1.3.6.1.4.1.641.2.1.5.3</OIDN>
</OID>
<OID type="counter">
    <name>count total copied black</name>
    <OIDN>1.3.6.1.4.1.641.2.1.5.7</OIDN>
</OID>

As you can see here, I mostly use 1.3.6.1.4.1.641 for my OIDs, but they only work for Lexmark. Are there more general OIDs that can be used, to find out how many pages there were printed in black/color, copied in black/color, faxed in black/color and scanned in different ways (simplex, duplex, flatbed), that I can use for basically any printer?

Regards.


回答1:


The short answer is 'no'. The details are going to be vendor specific.

You could do an snmpwalk of multiple different printers and compare the data to see if there is any common attributes you wanted to report on.

Each printer should have a printer specific MIB that will list all the details that you can query on the printer - so rather that starting with specific MIB values, if you scanned the MIB and searched for the interesting values you could find the right OID to poll for each platform.

At the start you could poll for the sysDescr mib entry, and determine if the device is a brother/epson/canon/hp printer etc.



来源:https://stackoverflow.com/questions/22655567/how-to-find-counters-of-printers-through-snmp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!