Is there an advantage to using Session instead of just writing your
own session? I guess most of the code I have been writing has been
using OO python bindings and it does seem to be written in an OO
fashion there, especially Session.
These are some of the python examples from test:
sess = netsnmp.Session(Version = 1, DestHost='localhost',
Community='public')
vars =
netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.2.116.101.115.116','','.1.3.6.1.6.1.1'),
netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.3.116.101.115.116','','1234'),
netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 4))
res = sess.set(vars)
But you don't have to do it that way, you can also just do:
var = netsnmp.Varbind('.1.3.6.1.2.1.1.1','0')
res = netsnmp.snmpget(var,
Version = 1,
DestHost='localhost',
Community='public')
print "v1 snmpget result: ", res, "\n"
On 6/1/07, Dave Shield <[EMAIL PROTECTED]> wrote:
> On 01/06/07, Noah Gift <[EMAIL PROTECTED]> wrote:
> > I would like to know more about session as well. It seems like an OO
> > construct? A high level Object to inherit?
>
> No - the Net-SNMP suite is not an object-oriented design.
>
> A "session" is the structure used to handle the connection to a
> remote agent (for a client application), or a listening socket
> (for an agent or trap receiver).
>
> Think of it as an overblown file descriptor.
>
> Dave
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders