> ...
> More particularly, the dump begins:
>
> 30 5B // request sequence
> 02 01 01 // version = SNMPv2c
> 04 00 // community = ""
> A0 54 // GET PDU
> <etc>
>
> So the request is being sent with an empty community string
> (hence it's not suprising that the agent is discarding it).
>
> That tends to point the finger at the client again - in particular
> the 'snmp_open' call. What does the 'ss' structure look like?
My code looks like this:
snmp_sess_init( &session ); /* set up defaults */
snmp_log(LOG_INFO, "snmp_sess_init() complete\n");
session.peername = "localhost";
session.retries = 1;
session.version = SNMP_VERSION_2c;
session.community = "config";
session.community_len = strlen(session.community);
snmp_log(LOG_INFO, "session.community:<<%s>>, community_len:%d\n",
session.community, session.community_len);
/* establish the session */
ss = snmp_open(&session);
snmp_log(LOG_INFO, "ss->community:<<%s>>, community_len:%d\n",
ss->community, ss->community_len);
and the resulting log is:
init_snmp() complete
snmp_sess_init() complete
session.community:<<config>>, community_len:6
snmp_open() complete
ss->community:<<(null)>>, community_len:1
connected
Sending 93 bytes to UDP: [127.0.0.1]:161
0000: 30 5B 02 01 01 04 00 A0 54 02 04 70 59 6C 67 02 0[......T..pYlg.
0016: 01 00 02 01 00 30 46 30 0C 06 08 2B 06 01 02 01 .....0F0...+....
0032: 01 01 00 05 00 30 0C 06 08 2B 06 01 02 01 01 04 .....0...+......
0048: 00 05 00 30 0C 06 08 2B 06 01 02 01 01 05 00 05 ...0...+........
0064: 00 30 0C 06 08 2B 06 01 02 01 01 06 00 05 00 30 .0...+.........0
0080: 0C 06 08 2B 06 01 02 01 01 03 00 05 00 ...+.........
So, snmp_open() appears to not be copying the community string. How come? I'll look
into it a bit shortly.
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
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