Re: netsnmp.client.Varbind (novice python question)

Vincent Bernat <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization One Piece
Message-ID <[email protected]>
OoO En ce début d'après-midi nuageux  du mardi 23 juin 2009, vers 14:03,
Dmitry Melekhov <[email protected]> disait :

> import netsnmp
> oid = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.2.1.2.2.1.2'))
> result = netsnmp.snmpwalk(oid,
>     Version = 2,
>     DestHost="192.168.22.253",
>     Community="public")
> print result
> print oid[0]

> I get
> <netsnmp.client.Varbind object at 0x7f62067e9750>
> for
> print oid[0]

You have :
 oid[0].val ( == "lo")
 oid[0].type ( == 'OCTETSTR')
 oid[0].tag ( == 'ifDescr')

Just do:
 dir(oid[0]) to find available attributes and methods.

BTW, if you need a more  high level interface for NetSNMP in Python, you
can try snimpy (as author, I find this is an incredible tool ;-) ):
 https://trac.luffy.cx/snimpy/
-- 
BOFH excuse #184:
loop found in loop in redundant loopback

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.