I am now at work and did some simple tests following examples at 
http://www.ibm.com/developerworks/aix/library/au-netsnmpnipython/

My results are:

    * v1 and v2 snmpwalk worked if specifiying 'sysDescr' but I got an
      output message of "sysDesr  = None ( None )".  The output of
      'result' was correct.

    * v1 and v2 snmpget and snmpwalk worked ok if specifiying
      'sysDescr.0'.  The prompt just returns and the output of 'result'
      was as expected :)

    * With v3 i get a major error if the value of AuthProto is in lower
      case.  The python interpreter exited back to the shell !!!  Note
      that standard snmpget command allows "-A sha" or "-A SHA" or "-A
      sHa" ...  Obviously using strcasecmp, but python bindings seem
      less forgiving.

     >>> import netsnmp
     >>> oid = netsnmp.Varbind('sysDescr.0')
     >>> result = netsnmp.snmpget(oid, Version=3,
    DestHost='10.0.100.177', SecName='admin', SecLevel='authNoPriv',
    AuthProto='sha', AuthPass='Password1')
    error:snmp_new_v3_session:Unsupported authentication protocol(sha)
    error:v3_session: couldn't open SNMP session().
    Bus error

    * Tried v3 with AuthProto='SHA' (instead of 'sha').  Python prompt
      returned without any error, but result was set to (None,) instead
      of expected text.  OK, the password was wrong so shouldn't python
      have returned some kind of authentication error ???

    * Tried v3 with AuthProto='SHA' and correct password.  Python prompt
      returned without any error and result was as expected :)


Cheers, Brendan.



Alexander Hansen wrote:
> Great!  It sounds like python bindings might be easy to implement once
> the maintainer is back (and has cleared his plate of other stuff).
>
>
> Brendan Simon wrote:
>   
>> I managed to get net-snmp-unified built and installed with the python
>> bindings.
>> My quick test seems to work.  Followed some simple python code tutorial
>> to do an snmpwalk on sysDescr and python did not complain.
>>
>>     


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-users mailing list
Fink-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to