如何通过SNMP查找打印机的计数器 [英] How to find counters of printers through SNMP

查看:351
本文介绍了如何通过SNMP查找打印机的计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开展一个项目,涉及通过SNMP从打印机获取信息。现在,我一直在测试/工作的打印机是Lexmark X950。

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.

我一直在努力解决的问题是,我希望这个程序能够用于HP或Kyocera或Brother打印机也是如此,但我使用的OID似乎只适用于Lexmark。

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.

以下是我使用的一些OID:

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>

正如你在这里看到的,我主要使用1.3.6.1.4.1.641作为我的OID,但是他们只为Lexmark工作。是否有更常用的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?

问候。

推荐答案

简短的回答是'不'。细节将取决于供应商。

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

你可以对多个不同的打印机进行snmpwalk并比较数据,看看是否有你想要报告的常见属性。

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.

每台打印机都应该有一台特定于打印机的MIB,它将列出您可以在打印机上查询的所有详细信息 - 而不是从特定的MIB值开始,如果您扫描了MIB并搜索了有趣的值,可以为每个平台找到合适的OID轮询。

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.

在开始时,您可以轮询sysDescr mib条目,并确定该设备是兄弟/ epson / canon / hp打印机等。

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

这篇关于如何通过SNMP查找打印机的计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆