Re: [snmpsim-users] device recording question
Brought to you by:
elie
|
From: Jason Kojro-B. <jba...@mo...> - 2013-05-02 21:22:17
|
Thank you for the very quick reply, Ilya! I was able to get the application to successfully start again. I will also play with snmprec and see if I can get it running without crashing. Thank you! Jason Kojro-Badziak Email: jba...@mo... -----Original Message----- From: Ilya Etingof [mailto:il...@gl...] Sent: Thursday, May 02, 2013 2:19 PM To: Jason Kojro-Badziak Cc: snm...@li... Subject: Re: device recording question Hi Jason, Right, use --process-user and --process-group options to specify your non-privileged user&group names to run simulator under their IDs. This is required to switch from root which is needed to bind to a privileged port like 161. -Ilya On May 2, 2013, at 22:34, Jason Kojro-Badziak <jba...@mo...> wrote: > Hello Ilya: > > I tried installing 0.2.2, but I am getting this error when I try to start the simulator: > > [root@snmp-sim IlyaSnmpSimFileController]# python /usr/bin/snmpsimd.py --data-dir=/opt/IlyaSnmpSimFileController/SNMPSimDataFiles --v2c-arch --agent-udpv4-endpoint=192.168.202.30:161 > ERROR: cant drop priveleges: Must drop priveleges to a non-priveleged user&group > Usage: /usr/bin/snmpsimd.py [--help] [--version ] > [--debug=<category>] [--daemonize] [--process-user=<uname>] > [--process-group=<gname>] [--logging-method=<method|?>] > [--data-dir=<dir>] [--cache-dir=<dir>] [--force-index-rebuild] > [--validate-data] [--variation-modules-dir=<dir>] > [--variation-module-options=<module[=alias][:args]>] > [--agent-udpv4-endpoint=<X.X.X.X:NNNNN>] > [--agent-udpv6-endpoint=<[X:X:..X]:NNNNN>] > [--agent-unix-endpoint=</path/to/named/pipe>] [--v2c-arch] [--v3-only] > [--v3-user=<username>] [--v3-auth-key=<key>] > [--v3-auth-proto=<SHA|NONE|MD5>] [--v3-priv-key=<key>] > [--v3-priv-proto=<3DES|AES256|NONE|DES|AES|AES128|AES192>] > > Any idea what the error means? > > Thank you! > > Jason Kojro-Badziak > Email: jba...@mo... > > > -----Original Message----- > From: Ilya Etingof [mailto:il...@gl...] > Sent: Wednesday, May 01, 2013 4:25 PM > To: Jason Kojro-Badziak > Cc: snm...@li... > Subject: Re: device recording question > > Hi Jason, > > Well, there seems to be a mess in simulator/modules versions. I'd suggest doing a clean install of the latest pre-release (0.2.2rc0): > > http://sourceforge.net/projects/snmpsim/files/snmpsim/0.2.2/snmpsim-0. > 2.2rc0.tar.gz/download > > or current development version: > > http://snmpsim.cvs.sourceforge.net/viewvc/snmpsim/snmpsim/?view=tar > > Those are pure-Python, not Windows executables. If setting it up and resolving its dependencies troubles you, I could build a Windows version right away. Let me know. > > Thanks, > ilya > > On Apr 30, 2013, at 7:01 PM, Jason Kojro-Badziak wrote: > >> Hello Ilya: >> >> Sorry for the late reply, but looks like you might be sending me the wrong version of the file again. Here is what I am seeing when I try to run the snmprec tool with the updated numeric.py file: >> >> Scanning "\Users\jkb\SNMP Simulator\Variation" directory for variation modules... no directory >> Scanning "C:\Users\jkb\AppData\Roaming\SNMP Simulator\Variation" directory for variation modules... no directory >> Scanning "C:\Program Files (x86)\SNMP Simulator\Variation" directory for variation modules... >> variation module C:\Program Files (x86)\SNMP >> Simulator\Variation\numeric.py execution failure: cannot import name >> log >> >> (If you would like to pause working on this for the time being, that >> is fine as I am actually in the middle of another project, and if it >> will be easier to wait on debugging this until after the next version >> is released, that is be fine by me.) >> >> Just so you know, I tried removing the "from snmpsim import log" line from "numeric.py", and it looks like something was at least starting to run correctly, but then the app crashed again and no output was written to the data file: >> >> Scanning "\Users\jkb\SNMP Simulator\Variation" directory for variation modules... no directory >> Scanning "C:\Users\jkb\AppData\Roaming\SNMP Simulator\Variation" directory for variation modules... no directory >> Scanning "C:\Program Files (x86)\SNMP Simulator\Variation" directory for variation modules... numeric module loaded >> SNMP version 2c >> Community name: [NA] >> Querying UDP/IPv4 agent at 192.168.200.128:161 >> Initializing variation module: >> numeric...OK >> Sending initial GETNEXT request.... >> Shutting down variation modules: >> numeric...OK >> OIDs dumped: 5281, elapsed: 133.68 sec, rate: 39.00 OIDs/sec >> Traceback (most recent call last): >> File "snmprec.py", line 500, in <module> >> NameError: global name 'log' is not defined >> >> >> Thank you! >> >> Jason Kojro-Badziak >> Monolith Software >> Staff Engineer >> 311 North 2nd Street, Suite #302 >> St. Charles, IL 60174 >> Office: 312-957-6470 x3010 >> Email: jba...@mo... >> >> -----Original Message----- >> From: Ilya Etingof [mailto:il...@gl...] >> Sent: Saturday, April 27, 2013 4:30 AM >> To: Jason Kojro-Badziak >> Cc: snm...@li... >> Subject: Re: device recording question >> >> Hi Jason, >> >> I beg your pardon for such a glitchy code! I've tried to rework it to address the issues you have encountered. So I'd appreciate if you try the latest version once again: >> >> http://snmpsim.cvs.sourceforge.net/viewvc/snmpsim/snmpsim/variation/n >> u >> meric.py >> >> Let me know in case of further issues. >> >> -ilya >> >> On Apr 25, 2013, at 7:21 PM, Jason Kojro-Badziak wrote: >> >>> Hi Ilya: >>> >>> I'm sorry, but looks like I'm getting the same error as before. Here is when I start the snmprec tool: >>> >>> ./snmprec.exe --agent-udpv4-endpoint=192.168.200.128 --version=2c --community=[COMMUNITY] --output-file="c:\Users\jkb\Desktop\vm-badziak.snmprec" --variation-module=numeric --variation-module-options=taglist:2-65-66-67-70,iterations:2,period:10 >>> Scanning "\Users\jkb\SNMP Simulator\Variation" directory for variation modules... no directory >>> Scanning "C:\Users\jkb\AppData\Roaming\SNMP Simulator\Variation" directory for variation modules... no directory >>> Scanning "C:\Program Files (x86)\SNMP Simulator\Variation" directory for variation modules... numeric module loaded >>> SNMP version 2c >>> Community name: [COMMUNITY] >>> Querying UDP/IPv4 agent at 192.168.200.128:161 >>> Initializing variation module: >>> numeric...OK >>> Sending initial GETNEXT request.... >>> OIDs dumped: 0/510 (<- this number keeps going up until 5000+) >>> >>> Then it changes to the below. (The "OIDs dumped:" line (from above) is getting changed into the "Shutting down variation modules:" line below): >>> >>> Shutting down variation modules: >>> numeric...OK >>> OIDs dumped: 5558, elapsed: 128.51 sec, rate: 3.00 OIDs/sec >>> numeric: waiting 0.00 sec(s), 5105 OIDs dumped, 1 iterations remaining... >>> Traceback (most recent call last): >>> File "snmprec.py", line 500, in <module> >>> KeyError: KeyError('value',) >>> >>> It does look like it's getting a little further now. The output >>> file that is being created is now much longer then it was before the >>> first update. (During this execution, I pressed the enter key every >>> couple of seconds, which is why there are multiple "OIDs dumped:" >>> lines.) >>> >>> Scanning "\Users\jkb\SNMP Simulator\Variation" directory for variation modules... no directory >>> Scanning "C:\Users\jkb\AppData\Roaming\SNMP Simulator\Variation" directory for variation modules... no directory >>> Scanning "C:\Program Files (x86)\SNMP Simulator\Variation" directory for variation modules... numeric module loaded >>> SNMP version 2c >>> Community name: [COMMUNITY] >>> Querying UDP/IPv4 agent at 192.168.200.128:161 >>> Initializing variation module: >>> numeric...OK >>> Sending initial GETNEXT request.... >>> OIDs dumped: 0/224 >>> OIDs dumped: 0/324 >>> OIDs dumped: 0/470 >>> OIDs dumped: 0/948 >>> OIDs dumped: 0/1861 >>> OIDs dumped: 0/2379 >>> OIDs dumped: 0/2639 >>> OIDs dumped: 0/2793 >>> OIDs dumped: 0/3005 >>> OIDs dumped: 0/3255 >>> OIDs dumped: 0/3494 >>> OIDs dumped: 0/3701 >>> OIDs dumped: 0/3858 >>> OIDs dumped: 0/4217 >>> OIDs dumped: 0/4423 >>> OIDs dumped: 0/4787 >>> OIDs dumped: 0/4934 >>> OIDs dumped: 1/5410 >>> OIDs dumped: 1/232 >>> OIDs dumped: 1/363 >>> Shutting down variation modules: >>> numeric...OK >>> OIDs dumped: 5491, elapsed: 143.79 sec, rate: 2.00 OIDs/sec >>> numeric: waiting 0.00 sec(s), 5110 OIDs dumped, 1 iterations remaining... >>> Traceback (most recent call last): >>> File "snmprec.py", line 500, in <module> >>> KeyError: KeyError('value',) >>> >>> >>> >>> >>> Thank you! >>> >>> Jason Kojro-Badziak >>> Email: jba...@mo... >>> >>> >>> -----Original Message----- >>> From: Ilya Etingof [mailto:il...@gl...] >>> Sent: Thursday, April 25, 2013 9:34 AM >>> To: Jason Kojro-Badziak >>> Cc: snm...@li... >>> Subject: Re: device recording question >>> >>> Hi Jason, >>> >>> Oh, yes, the numeric.py module I referred to is actually from (yet >>> unreleased) 0.2.2. Please, find the latest numeric.py without 0.2.2 dependency attached to this message. >>> >>> I hope to push a pre-release of 0.2.2 in a few days which would hopefully simplify things. >>> >>> -ilya >>> >>> On 04/25/13 18:13, Jason Kojro-Badziak wrote: >>>> Hi Ilya: >>>> >>>> I'm sorry, but now I'm getting a new error. Is there a more recent >>>> version of the simulator or other files that also need updating? I >>>> currently have 0.2.1 installed on my laptop. >>>> >>>> snmprec.exe --agent-udpv4-endpoint=192.168.200.128 >>>> --version=2c --community=[COMMUNITY] >>>> --output-file="c:\Users\jkb\Desktop\vm-badziak.snmprec" >>>> --variation-module=numeric >>>> --variation-module-options=taglist:2-65-66-67-70,iterations:2,period: >>>> 1 >>>> 0 >>>> >>>> Here is what was returned: >>>> >>>> Scanning "\Users\jkb\SNMP Simulator\Variation" >>>> directory for variation modules... no directory >>>> >>>> Scanning "C:\Users\jkb\AppData\Roaming\SNMP >>>> Simulator\Variation" directory for variation modules... no >>>> directory >>>> >>>> Scanning "C:\Program Files (x86)\SNMP >>>> Simulator\Variation" directory for variation modules... >>>> >>>> variation module C:\Program Files (x86)\SNMP >>>> Simulator\Variation\numeric.py execution failure: cannot import >>>> name log >>>> >>>> I put the new "numeric.py" file into the "C:\Program Files >>>> (x86)\SNMP Simulator\Variation\" directory, renaming the old file to " >>>> _numeric._p_y_.backup" hoping that it does not get loaded when I >>>> run snmprec. >>>> >>>> Also just so you know: >>>> >>>>> snmprec.exe -h >>>> >>>> SNMP Simulator version 0.2.1, written by Ilya Etingof >>>> <il...@gl...> >>>> >>>> I also tried this update on my linux server and I am getting the >>>> same >>>> results: >>>> >>>> python /usr/bin/snmprec.py >>>> --agent-udpv4-endpoint=192.168.200.128 --version=2c >>>> --community=[COMMUNITY] --output-file="/opt/vm-badziak.snmprec" >>>> --variation-module=numeric >>>> --variation-module-options=taglist:2-65-66-67-70,iterations:2,period: >>>> 1 >>>> 0 >>>> >>>> Output: >>>> >>>> Scanning "/root/.snmpsim/variation" directory for variation modules... >>>> no directory >>>> >>>> Scanning "/usr/share/snmpsim/variation" directory for variation >>>> modules... no directory >>>> >>>> Scanning >>>> "/usr/lib/python2.6/site-packages/snmpsim-0.2.2-py2.6.egg/snmpsim/variation" >>>> directory for variation modules... >>>> >>>> variation module >>>> /usr/lib/python2.6/site-packages/snmpsim-0.2.2-py2.6.egg/snmpsim/va >>>> r i a tion/numeric.py execution failure: cannot import name log >>>> >>>> The new file was put into the >>>> "/usr/lib/python2.6/site-packages/snmpsim-0.2.2-py2.6.egg/snmpsim/variation" >>>> directory. >>>> >>>> For some reason, I have a different version of the snmprec tool on >>>> my linux server: >>>> >>>> # python /usr/bin/snmprec.py -h >>>> >>>> SNMP Simulator version 0.2.2, written by Ilya Etingof >>>> <il...@gl...> >>>> >>>> Thank you for your assistance! >>>> >>>> Jason Kojro-Badziak >>>> >>>> Email: jba...@mo... >>>> >>>> -----Original Message----- >>>> From: Ilya Etingof [mailto:il...@gl...] >>>> Sent: Wednesday, April 24, 2013 5:21 PM >>>> To: Jason Kojro-Badziak >>>> Cc: snm...@li... >>>> Subject: Re: device recording question >>>> >>>> Hi Jason, >>>> >>>> That appeared to be a bug in numeric.py that is triggered by a >>>> *changing* set of OIDs between iterations. The quick fix is >>>> available from here: >>>> >>>> http://snmpsim.cvs.sourceforge.net/viewvc/snmpsim/snmpsim/variation >>>> / >>>> n >>>> u >>>> meric.py >>>> >>>> Please download this latest numeric.py file and replace your >>>> current numeric.py with it. >>>> >>>> Let me know in case of any issues. >>>> >>>> -ilya >>>> >>>> On Apr 25, 2013, at 12:55 AM, Jason Kojro-Badziak wrote: >>>> >>>>> Hi Ilya: >>>> >>>> >>>>> Sorry to bother you, but I am having an issue when I try to use >>>>> the >>>> snmprec application along with the recording module and I'm hoping >>>> you can help. If I use the snmprec tool without the "--variation" >>>> options, the snmprec file is created successfully. >>>> >>>> >>>>> Here is the command I am running: >>>> >>>> >>>>> c:\Program Files (x86)\SNMP Simulator>snmprec.exe >>>> --agent-udpv4-endpoint=192.168.200.128 --version=2c >>>> --community=[COMMUNITY STRING] >>>> --output-file="c:\Users\jkb\Desktop\vm-badziak.snmprec" >>>> --variation-module=numeric >>>> --variation-module-options=taglist:2-65-66-67-70,iterations:2,period: >>>> 1 >>>> 0 >>>> >>>> >>>>> When the applications starts, here is what I am initially seeing: >>>> >>>> >>>>> Scanning "\Users\jkb\SNMP Simulator\Variation" >>>> directory for variation modules... no directory >>>> >>>>> Scanning "C:\Users\jkb\AppData\Roaming\SNMP >>>> Simulator\Variation" directory for variation modules... no >>>> directory >>>> >>>>> Scanning "C:\Program Files (x86)\SNMP >>>> Simulator\Variation" directory for variation modules... numeric >>>> module loaded >>>> >>>>> SNMP version 2c >>>> >>>>> Community name: [COMMUNITY STRING] >>>> >>>>> Querying UDP/IPv4 agent at 192.168.200.128:161 >>>> >>>>> Initializing variation module: >>>> >>>>> numeric...OK >>>> >>>>> Sending initial GETNEXT request.... >>>> >>>>> OIDs dumped: 0/(5000+) >>>> >>>> >>>>> After what I am assuming is the first "run through" of all of the >>>> OIDs, the output changes to this: >>>> >>>> >>>>> Scanning "\Users\jkb\SNMP Simulator\Variation" >>>> directory for variation modules... no directory >>>> >>>>> Scanning "C:\Users\jkb\AppData\Roaming\SNMP >>>> Simulator\Variation" directory for variation modules... no >>>> directory >>>> >>>>> Scanning "C:\Program Files (x86)\SNMP >>>> Simulator\Variation" directory for variation modules... numeric >>>> module loaded >>>> >>>>> SNMP version 2c >>>> >>>>> Community name: [COMMUNITY STRING] >>>> >>>>> Querying UDP/IPv4 agent at 192.168.200.128:161 >>>> >>>>> Initializing variation module: >>>> >>>>> numeric...OK >>>> >>>>> Sending initial GETNEXT request.... >>>> >>>>> Shutting down variation modules: >>>> >>>>> numeric...OK >>>> >>>>> OIDs dumped: 5136, elapsed: 181.08 sec, rate: 0.00 >>>> OIDs/sec >>>> >>>>> Traceback (most recent call last): >>>> >>>>> File "snmprec.py", line 500, in <module> >>>> >>>>> KeyError: KeyError('value',) >>>> >>>> >>>>> In the resulting data file, there are a few lines, but there are >>>> not >>>> 5000+ OIDs dumped as it says in the output. >>>> >>>> >>>>> Any idea what is going wrong? I have also tried this on the linux >>>> server and I am getting the same results. I have also tried using >>>> smaller taglists to see if that was the problem, but sadly, it is not. >>>> >>>> >>>>> Just so you know: >>>> >>>>> c:\Program Files (x86)\SNMP Simulator>snmprec -h >>>> >>>>> SNMP Simulator version 0.2.1, written by Ilya Etingof >>>> <il...@gl... <mailto:il...@gl...>> >>>> >>>> >>>>> Thank you! >>>> >>>>> Jason Kojro-Badziak >>>> >>>>> Email: jba...@mo... >>>> <mailto:jba...@mo...> >>>> > |