I have just started working with net_snmp and am having trouble getting
a session to open without error.

snmpget returns data fine from the command line, but I am trying to
get simple things to work programatically.

Here are the steps I have taken:

snmp.conf:
default port  162
defcommunity public

snmpd.conf:
rwcommunity  public

Then, following the simple example on the website:
(Well OK, these are all wrapped in C++ objects)
(All snmp libraries are linked to my executable)

init_snmp("C:/path/to/MyExecutable")
snmp_sess_init(&session)

session.peername = "127.0.0.1"; (also tried "localhost")
session.version = SNMP_VERSION_1;
session.community = "public";
and set community length.

SOCK_STARTUP // for Windows

ss = snmp_open(&session);


The return pointer is null and the session did not open.

the session.s_errno and s_snmp_errno fields of the session struct are both 0.

I have tried retrieving error data with: snmp_error(&session,
NULL,NULL,&charptr),
and I get some stuff about NotifyfilterGroup and other things  in
NOTIFICATION-MIB.txt .

I have configured the Windows firewall to open port 162 for snmp over UDP.

Any help much appreciated. I am sure there is something simple that I
have overlooked.

Thanks in advance,

Geoffrey Bays

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to