Re: snmpset with Python

Vincent Bernat <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization One Piece
Message-ID <[email protected]>
OoO Pendant le  repas du mercredi 01 juillet  2009, vers 19:23, François
Dumont <[email protected]> disait :

>     import netsnmp

>     oid = "ipIfConfigIpAddress"
>     Version = 2
>     DestHost = "10.0.0.1"
>     Communuty = "private"

>     result = netsnmp.snmpwalk(oid, Version = Version, DestHost = DestHost,
>     Community = Community)


> But with snmpset, it doesn't work (certainly because I don't use it as it has
> to be used) :


>     oid = netsnmp.Varbind('ipIfConfigIpAddress')

Use:
 netsnmp.Varbind('sysName', 'hello')

For  IP  address, I  am  not  really sure  how  you  should  set such  a
value. You should try '127.0.0.1' and struct.pack('bbbb', 127, 0, 0, 1).

>     result = netsnmp.snmpset(oid, Version = Version, DestHost = DestHost,
>     Community = Community)

> It returns "Segmentation fault".

NetSNMP bindings for Python are not error-tolerant.
-- 
I AM NOT DELIGHTFULLY SAUCY
I AM NOT DELIGHTFULLY SAUCY
I AM NOT DELIGHTFULLY SAUCY
-+- Bart Simpson on chalkboard in episode 1F14

------------------------------------------------------------------------------
_______________________________________________
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.