几年前我在不同的系统上使用它,但我现在无法使用它。我在Windows 7 x64上使用Net-SNMP 5.5 x64(所有更高版本崩溃),我正在尝试将Xerox打印机(http://origin-download.support.xerox.com/pub/drivers/MIBs/)的.mib文件加载到其中,这样我就可以进行如下调用/ p>
snmptranslate -m ALL -On XEROX-SERVICE-MONITORING-MIB::xcmSvcMonServiceStateDetail.27
我尝试将asn文件夹中的文件放入我的share / snmp / mibs文件夹中,但是当我这样做时,我犯了很多错误并且没有进行查找
Desktop>snmptranslate -m +XEROX-COMMON-MIB snmptranslate -m ALL -On XEROX-SERVICE-MONITORING-MIB::xcmSvcMonServiceStateDetail.27
Cannot find module (IANA-CHARSET-MIB): At line 23 inC:/usr/share/snmp/mibs/xerox.one
Cannot find module (Job-Monitoring-MIB): At line 32 in C:/usr/share/snmp/mibs/xerox.one
Cannot find module (Printer-MIB): At line 41 in C:/usr/share/snmp/mibs/xerox.one
Did not find 'IANACharset' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobEntry' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobState' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobStateReasons1' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmNumberOfInterveningJobs' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobKOctetsPerCopyRequested' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobKOctetsProcessed' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobImpressionsPerCopyRequested' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'jmJobImpressionsCompleted' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'PresentOnOff' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'prtGeneralEntry' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'prtInputEntry' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'prtOutputEntry' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'prtChannelEntry' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'prtInterpreterEntry' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Did not find 'prtInterpreterIndex' in module #-1 (C:/usr/share/snmp/mibs/xerox.one)
Unlinked OID in XEROX-COMMON-MIB: mib-2 ::= { mgmt 1 }
Undefined identifier: mgmt near line 38532 of C:/usr/share/snmp/mibs/xerox.one
snmptranslate: (Sub-id not found: (top) -> snmptranslate)
任何帮助都会受到赞赏。
答案 0 :(得分:2)
尝试 net-snmp-config --default-mibdirs
查看当前搜索路径。
并且,如果这与您期望的不同,您可以尝试在snmptranslate
命令中添加 -M +C:/usr/share/snmp/mibs
和 -m ALL
在C:/usr/share/snmp/mibs
中添加任何MIB。
man snmpcmd
显示
snmpcmd - options and behaviour common to most of the Net-SNMP command-line tools
// SNIP
-m MIBLIST
Specifies a colon separated list of MIB modules (not files) to load for this application. This overrides (or augments) the environment variable MIBS, the snmp.conf
directive mibs, and the list of MIBs hardcoded into the Net-SNMP library.
If MIBLIST has a leading '-' or '+' character, then the MIB modules listed are loaded in addition to the default list, coming before or after this list respectively.
Otherwise, the specified MIBs are loaded instead of this default list.
The special keyword ALL is used to load all MIB modules in the MIB directory search list. Every file whose name does not begin with "." will be parsed as if it were a
MIB file.
-M DIRLIST
Specifies a colon separated list of directories to search for MIBs. This overrides (or augments) the environment variable MIBDIRS, the snmp.conf directive mibdirs,
and the default directory hardcoded into the Net-SNMP library (/usr/share/snmp/mibs).
If DIRLIST has a leading '-' or '+' character, then the given directories are added to the default list, being searched before or after the directories on this list
respectively. Otherwise, the specified directories are searched instead of this default list.
Note that the directories appearing later in the list have have precedence over earlier ones. To avoid searching any MIB directories, set the MIBDIRS environment
variable to the empty string ("").
Note that MIBs specified using the -m option or the mibs configuration directive will be loaded from one of the directories listed by the -M option (or equivalents).
The mibfile directive takes a full path to the specified MIB file, so this does not need to be in the MIB directory search list.