首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Net-SNMP添加.mib文件

Net-SNMP添加.mib文件
EN

Stack Overflow用户
提问于 2015-07-28 19:20:16
回答 1查看 21.5K关注 0票数 1

几年前,我把它用在了另一种系统上,但现在我不能让它工作了。我在Windows7 x64上使用Net 5.5 x64 (所有较晚的版本崩溃),并且我试图将施乐打印机(http://origin-download.support.xerox.com/pub/drivers/MIBs/)的.mib文件加载到其中,这样我就可以执行如下的调用

代码语言:javascript
运行
复制
   snmptranslate -m ALL -On XEROX-SERVICE-MONITORING-MIB::xcmSvcMonServiceStateDetail.27

我试图将asn文件夹中的文件放入我的share/snmp/mibs文件夹中,但是当我这样做时,会产生很大的错误,而且它不会进行查找。

代码语言:javascript
运行
复制
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) 

任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2015-07-29 09:06:23

尝试net-snmp-config --default-mibdirs查看当前搜索路径。

而且,如果这与您所期望的不同,您可以尝试将-M +C:/usr/share/snmp/mibs-m ALL添加到snmptranslate命令中,以在C:/usr/share/snmp/mibs中添加任何MIB。

man snmpcmd显示

代码语言:javascript
运行
复制
snmpcmd - options and behaviour common to most of the Net-SNMP command-line tools

//狙击

代码语言:javascript
运行
复制
   -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.
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31685288

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档