etingof / snmpsim

SNMP Simulator
http://snmplabs.com/snmpsim/
BSD 2-Clause "Simplified" License
383 stars 120 forks source link

Issue in creating .snmprec #147

Closed chougulepavan closed 4 years ago

chougulepavan commented 4 years ago

Hi, I am trying to create .snmprec file from MIBs getting following error,

$ snmpsim-record-mibs --output-file=/home/prashant/public_1.snmprec --mib-module=ALARM-MIB

MIB module: ALARM-MIB, from the beginning till the end

Traceback (most recent call last): File "/usr/local/bin/snmpsim-record-mibs", line 9, in load_entry_point('snmpsim==1.0.0', 'console_scripts', 'snmpsim-record-mibs')() File "/usr/local/lib/python2.7/dist-packages/snmpsim-1.0.0-py2.7.egg/snmpsim/commands/mib2rec.py", line 461, in main if not args.row_hint: AttributeError: 'Namespace' object has no attribute 'row_hint'

--mib-module variable should be MIB file name itself or Definition name from MIB file?

And also can we parse the entire MIB folder to create .snmprec?

gainskills commented 4 years ago

@chougulepavan can you try the fork: https://github.com/gainskills/snmpsim to see if it works as expected?

Thanks,

gainskills commented 4 years ago

Duplicate to https://github.com/etingof/snmpsim/issues/133

chougulepavan commented 4 years ago

Yes, I am able to create now. Thank you.

tkekan commented 4 years ago

@chougulepavan /@gainskills How to create new modules for mib's ? I tried to record data for a mib module which you used, but seems it's not present in the repo. I'm looking to record simulation data for new mib files. Can you please help here ?

snmpsim-record-mibs --output-file=./data/publictest_1.snmprec --mib-module=ALARM-MIB

MIB module: ALARM-MIB, from the beginning till the end

ERROR: failed on MIB ALARM-MIB: ALARM-MIB compilation error(s): missingcaused by <class 'pysnmp.smi.error.MibNotFoundError'>: MIB file "ALARM-MIB.py[co]" not found in search path (DirMibSource('/Users/tkekan/oracle/wrk/snmp-poller/poller-venv/lib/python2.7/site-packages/pysnmp/smi/mibs'), DirMibSource('/Users/tkekan/oracle/wrk/snmp-poller/poller-venv/lib/python2.7/site-packages/pysnmp/smi/mibs/instances'), DirMibSource('pysnmp_mibs'), DirMibSource('/Users/tkekan/.pysnmp/mibs'))caused by <type 'exceptions.IOError'>: [Errno 2] No suitable module found: 'ALARM-MIB'