尝试使用mibdump.py
工具为PySNMP编译一些Juniper MIB。它似乎无法找到JUNIPER_SMI
包中的现有pysnmp-mibs
模块。
该模块似乎存在:
root@2a614c91783e:~# ls -al /usr/local/lib/python3.6/site-packages/pysnmp_mibs/JUNIPER-SMI.py
-rw-r--r-- 1 root staff 10690 Dec 11 23:03 /usr/local/lib/python3.6/site-packages/pysnmp_mibs/JUNIPER-SMI.py
mibdump.py
的输出表示正在使用pysnmp.smi.mibs
和pysnmp_mibs
作为现有包:
root@2a614c91783e:~# /usr/local/bin/mibdump.py --mib-source /mibs/JuniperMibs --mib-source /ibs/StandardMibs --mib-stub mib-jnx-bgpmib2.txt mib-jnx-exp.txt
Source MIB repositories: /mibs/JuniperMibs, /ibs/StandardMibs
Borrow missing/failed MIBs from: http://mibs.snmplabs.com/pysnmp/notexts/@mib@
Existing/compiled MIB locations: pysnmp.smi.mibs, pysnmp_mibs
Compiled MIBs destination directory: /root/.pysnmp/mibs
MIBs excluded from code generation: mib-jnx-bgpmib2.txt
MIBs to compile: mib-jnx-exp
Destination format: pysnmp
Parser grammar cache directory: not used
Also compile all relevant MIBs: yes
Rebuild MIBs regardless of age: no
Dry run mode: no
Create/update MIBs: yes
Byte-compile Python modules: yes (optimization level no)
Ignore compilation errors: no
Generate OID->MIB index: no
Generate texts in MIBs: no
Keep original texts layout: no
Try various file names while searching for MIB module: yes
Created/updated MIBs:
Pre-compiled MIBs borrowed:
Up to date MIBs:
Missing source MIBs: JUNIPER-SMI, SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC
Ignored MIBs:
Failed MIBs: JUNIPER-EXPERIMENT-MIB (no module "JUNIPER-SMI" in symbolTable at MIB JUNIPER-EXPERIMENT-MIB)
Python和包版本:
root@2a614c91783e:~# pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.1)
ply (3.10)
pyasn1 (0.4.2)
pycryptodomex (3.4.7)
pysmi (0.2.2)
pysnmp (4.4.2)
pysnmp-mibs (0.1.6)
setuptools (36.6.0)
wheel (0.30.0)
root@2a614c91783e:~# python --version
Python 3.6.3
不确定我在这里缺少什么。我错过了一些不能让我检测现有模块的明显事物吗?
答案 0 :(得分:0)
mibdump.py
工具将搜索已存在的JUNIPER-SMI.py
以保存JUNIPER-SMI.txt
编译。如果您有另一个依赖于JUNIPER-SMI.txt
的MIB,那么已编译JUNIPER-SMI.py
无法提供帮助。
如果您只是在--mib-source http://mibs.snmplabs.com/asn1/
命令调用中添加mibdump.py
参数,该工具将从上面的URL获取所有必需的ASN.1 MIB并将其编译为.py。