2009/7/8 Dave Shield <d.t.shi...@liverpool.ac.uk>
> [ First - *please* don't mail me privately, without copying
> any responses to the mailing list. I don't have the time
> or inclination to offer private, unpaid, SNMP consultancy.
> Keep discussions to the list, where others can both learn
> and offer advice. Thanks. ]
Sorry about that, I thought I was sending this email to everyone.
> 2009/7/7 François Dumont <francoisdumon...@gmail.com>:
> >> I'm not familiar with the python interface, so I can't comment on
> >> what the underlying problem might be. You may need to try and
> >> pin down the exact characteristics that trigger the problem.
> >> Is it a particular type of assignment, or a particular value? Does
> >> the order in which assignments are applied make a difference?
> >> Is it the same behaviour every time, or is there some element of
> >> randomness?
> >
> > The order of assignements doesn't make a difference, the function take
> all
> > parameters you put in and replace it into the session list. For example,
> if
> > you put DestHost = '127.0.0.1', it replaces DestHost = 'localhost' by
> > DestHost = '127.0.0.1'. Because of the predefine name (like DestHost),
> the
> > order is not important.
>
> That's not quite what I meant.
>
> For example - the code that you quoted shows an assignment to
> rbQoSProfileName (which works) followed by an assignment to
> rbQoSProfileType (which fails).
> Do you get the same results if the rbQoSProfileType assignment
> comes first, before the rbQoSProfileName assignment?
I tried to reverse the order between rbQoSProfileType assignment and
rbQoSProfileName assignment, this is the same result. So, this is not the
problem.
The script also prompts for "Which QoS Profile to edit", which I
> presume is the index to the table. You haven't said anything about
> what index value(s) you are trying with.
> Do you get this behaviour with every row in the table, or just the
> one? What about when you try with a non-existing row vs one
> that already exists.
I'm trying to edit the last index (this is a new entry in the table just for
tests), but I tried with the others, even with a row that doesn't exist, and
this is the same too. So, to be clear, in the table of QoS Profiles, the
columns of name, parameter 1 and parameter 2 can be modified and dispayed,
whatever the index I use. But the columns of type, time parameter and row
status cannot be modified, whatever the index I use.
> The behaviour is always the same, there is no randomness.
> >
> > I'm still trying to find the problem by debogging with pdb.
>
> My basic advice would be to try and reduce the program as much
> as possible - paring it down to the bare minimum that still triggers
> the problem. Ideally with fixed values rather than prompted ones.
I reduced the python script to this :
qosType = raw_input("Enter the new type (0 = rbCG, 1 = rbRT, 2 = rbNRT, 3 =
> rbBE) :\n")
> value = "rbQoSProfileType"
> oid = netsnmp.Varbind(value, profileNb, qosType)
> resultSet = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> #resultGet = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("get result : %s") %(resultSet)
> #print("%s = %s") %(value,resultGet)
>
If I run this python script, it returns (resultSet) 0, so the set didn't
succeed. If I uncomment the two commented lines, it returns a segmentation
fault. I followed step by step what does the script with the pdb debogger,
and I found that this is when it enters the get function that it fails (and
gives the segmentation fault).
Other thoughts:
> - it's not entirely clear to me *what* is seeing the segmentation fault.
> The script? The agent? or something else....
>
> - if it's the script that crashes, then it would be useful to check
> whether
> this happens before the SET request is sent out, or when it receives the
> response.
I think the answer is just above.
> If this was a command-line problem (or a C-based program), I'd suggest
> turning on the raw packet dumps. I'm not sure what facilities are
> available
> via the python interface, but something similar might help clarify exactly
> what is happening.
>
> - It might also be worth crafting an equivalent test program using one
> of the other APIs (e.g. perl or C) as a comparison.
I will try with another programming language (like C) as a comparison.
> Dave
>
Thank you
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users