我在Windows 101803上使用Net 5.5.0-2.x64。我正在尝试从理光打印机获取SNMP值。我下载了打印机-MIB并将其放在我的C:\usr\share\snmp\mibs文件夹中。我还下载并放置了IANA-字符集-MIB和IANA-打印机-MIB。我还双重检查了snmp.conf,以确保它们位于正确的mibdirs文件夹中。
我在试着获取黑墨粉的价值。我找到了一些OID 这里,我正试图在我的示例中使用它。
当我试图访问黑色墨粉的值时:
snmpwalk -v 1 -c public -m Printer-MIB x.x.x.x 1.3.6.1.4.1.367.3.2.1.2.24.1.1.5.1
我得到了
SNMPv2-SMI::enterprises.367.3.2.1.2.24.1.1.5.1 = INTEGER: 80
当我尝试-m ALL时,我也得到了同样的结果。另外,如果我尝试在末尾添加Printer-MIB::printmib,就会得到相同的消息。当我尝试命令时:
snmptranslate -IR -Td Printer-MIB::prtMarkerSuppliesLevel.1.1
我得到了
Printer-MIB::prtMarkerSuppliesLevel.1.1
prtMarkerSuppliesLevel OBJECT-TYPE
-- FROM Printer-MIB
SYNTAX Integer32 (-3..2147483647)
MAX-ACCESS read-write
STATUS current
DESCRIPTION "The current level if this supply is a container; the remaining
space if this supply is a receptacle. If this supply
container/receptacle can reliably sense this value, the value
is reported by the printer and is read-only; otherwise, the
value may be written (by a Remote Control Panel or a Management
Application). The value (-1) means other and specifically
indicates that the sub-unit places no restrictions on this
parameter. The value (-2) means unknown. A value of (-3) means
that the printer knows that there is some supply/remaining
space, respectively."
::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) printmib(43) prtMarkerSupplies(11) prtMarkerSuppliesTable(1) prtMarkerSuppliesEntry(1) prtMarkerSuppliesLevel(9) 1 1 }所以,这不意味着SNMP会看到文件并能够解析它吗?
编辑:
我能够让MIB文件正常工作,但是OID值让我很困惑。我运行snmpwalk -v 1 -c public x.x.x.x Printer-MIB::printmib,现在打印带有MIB标记的值。但是,当我看到黑色墨水的值时,OID与我找到的在线不匹配,但是它们返回相同的值。
C:\usr\bin>snmpwalk -v 1 -c public x.x.x.x Printer-MIB::prtMarkerSuppliesLevel.1.1
Printer-MIB::prtMarkerSuppliesLevel.1.1 = INTEGER: 80和
C:\usr\bin>snmpwalk -v 1 -c public x.x.x.x 1.3.6.1.4.1.367.3.2.1.2.24.1.1.5.1 Printer-MIB::printmib
SNMPv2-SMI::enterprises.367.3.2.1.2.24.1.1.5.1 = INTEGER: 80如果我运行snmptranslate,我得到的OID与我以前使用的完全不同:
C:\usr\bin>snmptranslate -On Printer-MIB::prtMarkerSuppliesLevel.1.1
.1.3.6.1.2.1.43.11.1.1.9.1.1不知道为什么我在网上找到的OID可以检索值,但不能使用MIB文件。私有数据和公共MIB数据之间的某种混合?
发布于 2018-12-05 15:07:21
尝试正确的OID
蛇行. 1.3.6.1.2.1.43.5.1.1.16
https://stackoverflow.com/questions/53625248
复制相似问题