Re: [snmpsim-users] snmpbulkget outpu in version 0.2.2
Brought to you by:
elie
|
From: Bhagat, Y. (Yateen) <yat...@al...> - 2013-06-12 07:08:57
|
Hi Ilya
While trying to start snmpsimd.py I am getting error
Traceback (most recent call last):
File "C:\snmpsim-0.2.3\scripts\snmpsimd.py", line 38, in <module>
from snmpsim import confdir, log, daemon
ImportError: cannot import name log
What could be wrong here? (Sorry, I have very little knowledge of python )
Thanks
Yateen
From: Ilya Etingof [mailto:il...@gl...]
Sent: Monday, June 10, 2013 7:27 PM
To: Bhagat, Yateen (Yateen)
Cc: snm...@li...
Subject: Re: snmpbulkget outpu in version 0.2.2
Hi Yateen,
Alright, could you take the latest snmpsim:
https://pypi.python.org/packages/source/s/snmpsim/snmpsim-0.2.3.tar.gz
run it with the fixed snmprec file, take a capture of SNMP exchanges and send be pcap file?
With --v2c-arch option SNMP engine is not used so there will be no debug. I missed that while suggesting you running snmpsim in debug mode, sorry.
The manager script I sent you might need some adjustments (IP, ports, community names) to run in your environment.
-ilya
On 06/10/13 15:30, Bhagat, Yateen (Yateen) wrote:
Hi Ilya
I tried the fixed snmprec file, but did get the same results.(OID not showing up in the same order as requested in the getbulk command from manager)
(My pysnmp version is 4.2.2 )
I started the snmpsim with -debug-msgproc option and executed my snmpbulget script. However there was no debug output on the console of snmpsim
When I tried your manager script (getbul-yateen.py), got an error: No SNMP response received before timeout
Thanks
Yateen
From: Ilya Etingof [mailto:il...@gl...]
Sent: Saturday, June 01, 2013 9:48 PM
To: Bhagat, Yateen (Yateen)
Cc: KARNAM, Mahendra (Mahendra)
Subject: Re: snmpbulkget outpu in version 0.2.2
Hi Yateen,
My tests do not reproduce this issue. What pysnmp version you are actually using? You can check that by running:
$ python -c 'import pysnmp; print pysnmp.version'
(4, 2, 4)
Also, I noticed that your snmprec file is unsorted and contains invalid elements. I've cleaned it up a little and sending you the result. You may wish to try my version to see if it makes any difference.
Finally, I'm sending you the Manager tool I'm using for testing. Let's see if it would reproduce the problem for you?
If neither helps, I'd ask you to run snmpsimd with the --debug=msgproc command-line flag and send me simulator output for further analysis.
-ilya
On May 31, 2013, at 11:24 AM, Bhagat, Yateen (Yateen) wrote:
> Hi Ilya,
>
>
> I tried bulkget on plain .snmprec , but still got the same results.
> The snmprecfile and the bulkget response capture from wireshark are attached here.
>
> Note : this time too I got 28 varbinds against expected 35.
>
> Thanks
> Yateen
>
> -----Original Message-----
> From: Ilya Etingof [mailto:il...@gl...]
> Sent: Friday, May 31, 2013 1:57 AM
> To: Bhagat, Yateen (Yateen)
> Cc: snm...@li...<mailto:snm...@li...>; KARNAM, Mahendra (Mahendra)
> Subject: Re: snmpbulkget outpu in version 0.2.2
>
> Hi Yateen,
>
> First thing that come to mind is that you may not have all the OIDs in your SQL DB. Could you make sure the following table contains OIDs you expect to see in response:
>
> select oid from snmprec order by oid
>
> If that does not explain the problem, could you send me the sqlite .db file in question?
>
> Does this issue show up when using plain .snmprec, not SQL DB?
>
> -ilya
>
> On May 30, 2013, at 4:13 PM, Bhagat, Yateen (Yateen) wrote:
>
>> Hi Ilya
>>
>> I have observed that the snmpbulkget request output from snmpsim is not in proper order.
>>
>> Our snmp manager sends a bulkget request for "particular OIDs and repeat count" as shown in the perl snippet below:
>>
>> $max_reps=5;
>> $alarmSeqNo=272164;
>> $result = $session->get_bulk_request(
>> -maxrepetitions => $max_reps,
>> -varbindlist => [
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.$alarmSeqNo",
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.$alarmSeqNo",
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.6.$alarmSeqNo",
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.2.$alarmSeqNo",
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.7.$alarmSeqNo",
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.5.$alarmSeqNo",
>> "1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.$alarmSeqNo",
>> ],
>> );
>>
>> The real SNMP agent node returns the response as under ( as seen in
>> wireshark)
>>
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.272165' => 2322,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.272165' => '11#3',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.6.272165' => '0x07dd051e091a1900',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.2.272165' => 39,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.7.272165' => 1,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.5.272165' => 1,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.272165' => '',
>> ------------
>> ------------
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.272169' => 2322,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.272169' => '11#3',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.6.272169' => '0x07dd051e091a1900',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.2.272169' => 39,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.7.272169' => 1,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.5.272169' => 1,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.272169' => '',
>>
>> Note : 1. The OIDs are returned in the same order as specified in the request (ref perl snippet)
>> 2. The number of OIDs returned = 7*5=35 as expected ( request
>> has 7 OIDs and repeat count of 5)
>>
>> However when the same bulkget request is sent to the snmpsim, the response is different as under:
>>
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.272165' => 2322,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.272166' => 2322,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.272167' => 2322,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.3.272168' => 2322,
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.272165' => '11#1',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.272166' => '11#3',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.272167' => '11#0',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.4.272168' => '11#0'
>> ---------
>> ---------
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.272165' => '',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.272166' => '',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.272167' => '',
>> '1.3.6.1.4.1.637.74.1.2.2.1.1.1.4.1.10.272168' => '',
>>
>> Note : 1. The OIDs are returned in an order DIFFERENT from one
>> specified in the request (ref perl snippet) 2. The number of OIDs returned is not 7*5=35 as expected it retuned only 28 , OIDs for the last index number
>> 272169 were missing
>>
>> Please help !
>>
>> Regards
>> Yateen
>
> <StaticSnmpsim_getBul_response.bmp><135.250.33.68.snmprec>
|