Re: Still some more problems using python module
This is a multi-part message in MIME format.
--===============1093112989==
Content-Type: multipart/alternative;
boundary="------------050601000501050906090709"
This is a multi-part message in MIME format.
--------------050601000501050906090709
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I fixed the python module "client.py" to accept the concatentated label
and index, because from the source code you can tell this was allowable.
It was a regular expression error that only allowed one digit instead of
multiple digits.
I'll try and submit a patch.
Jack G Atkinson Jr wrote:[color=blue]
> Got it figured out! Woohoo!
>
> The problem was concatenating the label with the index!
>
> The label and the index need to be passed separately to the Varbind()
> function!
>
> Example:
>
> Varbind(tag = 'adGenEasyBridgeRowStatus', iid='20', val = '5', type =
> 'INTEGER')
>
> or just:
>
> Varbind('adGenEasyBridgeRowStatus', '20', '5', 'INTEGER')
>
> Not :
> Varbind(tag='adGenEasyBridgeRowStatus.20', iid=None,val='5',
> type='INTEGER')
>
> It would work with the single digits for some reason.
>
> I wish that was more clear in the documentation or else I need to work
> on my comprehensive reading skills some more.
>
>
> BTW, iid and val can actually be integers, the python module will
> convert them to strings.
>
> Thanks for the help.
>
> Mike Ayers wrote:[color=green][color=darkred]
>>> From: Jack G Atkinson Jr [mailto:jgatkinsn@gmail.com]
>>> Sent: Tuesday, January 22, 2008 3:48 PM
>>>[/color]
>>
>>[color=darkred]
>>> I have done a little more investigating, and it seems to
>>> consistently fail when I go from a one digit index to two
>>> digits. I did this repeatedly by deleting all the rows after
>>> a failure. I'm trying to look at the string creation part
>>> and the hand off to the netsnmp command at the lower level,
>>> and see if something is going wrong. For the life of me, I
>>> can't see why that extra digit is making a difference.
>>>[/color]
>>
>> I don't have my python refs handy, but I do recall the automatic number conversions giving me some grief. I note that you are taking the returned get value, which appears, from the code you sent, to return a string, and are passing it back to set, declared as an integer. You may want to add 0 to it before doing it, just to ensure that it can be accepted as an integer.
>>
>>
>> HTH,
>>
>> Mike
>>
>>[/color]
>
>
> --[/color]
--------------050601000501050906090709
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I fixed the python module "client.py" to accept the concatentated label
and index, because from the source code you can tell this was
allowable. It was a regular expression error that only allowed one
digit instead of multiple digits.<br>
<br>
I'll try and submit a patch.<br>
<br>
<br>
<br>
Jack G Atkinson Jr wrote:
<blockquote cite="mid:479696FC.50102@gmail.com" type="cite">
<meta content="text/html;charset=iso-8859-1" http-equiv="Content-Type">
Got it figured out! Woohoo!<br>
<br>
The problem was concatenating the label with the index!<br>
<br>
The label and the index need to be passed separately to the Varbind()
function!<br>
<br>
Example:<br>
<br>
Varbind(tag = 'adGenEasyBridgeRowStatus', iid='20', val = '5', type =
'INTEGER')<br>
<br>
or just:<br>
<br>
Varbind('adGenEasyBridgeRowStatus', '20', '5', 'INTEGER')<br>
<br>
Not :<br>
Varbind(tag='adGenEasyBridgeRowStatus.20', iid=None,val='5',
type='INTEGER')<br>
<br>
It would work with the single digits for some reason.<br>
<br>
I wish that was more clear in the documentation or else I need to work
on my comprehensive reading skills some more.<br>
<br>
<br>
BTW, iid and val can actually be integers, the python module will
convert them to strings.<br>
<br>
Thanks for the help.<br>
<br>
Mike Ayers wrote:
<blockquote
cite="mid:83E753BE7B6A324ABB336245BAF1DAAC07CDC3A9@mailserver.metatv-ds.metatv.com"
type="cite">
<blockquote type="cite">
<pre wrap="">From: Jack G Atkinson Jr [<a moz-do-not-send="true"
class="moz-txt-link-freetext" href="mailto:jgatkinsn@gmail.com">mailto:jgatkinsn@gmail.com</a>]
Sent: Tuesday, January 22, 2008 3:48 PM
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">I have done a little more investigating, and it seems to
consistently fail when I go from a one digit index to two
digits. I did this repeatedly by deleting all the rows after
a failure. I'm trying to look at the string creation part
and the hand off to the netsnmp command at the lower level,
and see if something is going wrong. For the life of me, I
can't see why that extra digit is making a difference.
</pre>
</blockquote>
<pre wrap=""><!---->
I don't have my python refs handy, but I do recall the automatic number conversions giving me some grief. I note that you are taking the returned get value, which appears, from the code you sent, to return a string, and are passing it back to set, declared as an integer. You may want to add 0 to it before doing it, just to ensure that it can be accepted as an integer.
HTH,
Mike
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- </pre>
</blockquote>
<br>
</body>
</html>
--------------050601000501050906090709--
--===============1093112989==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
[url]http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/[/url]
--===============1093112989==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Net-snmp-users mailing list
[email]Net-snmp-users@lists.sourceforge.net[/email]
Please see the following page to unsubscribe or change other options:
[url]https://lists.sourceforge.net/lists/listinfo/net-snmp-users[/url]
--===============1093112989==--