hello friends
for finding reason for this failure i found that
following function get call when i call init_agent
init_agent
|--subagent_pre_init
|--agentx_reopen_session
|--subagent_open_master_session
|---snmp_open_ex
|---snmp_sess_open
|-- _sess_open
|---netsnmp_tdomain_transport
netsnmp_tdomain_transport called as follows
slp->transport = netsnmp_tdomain_transport
& this netsnmp_tdomain_transport function fails it returns NULL
because of this session not get completed & so by this flow of code
if (main_session == NULL) {
printf("\n Failure snmp_open_ex\n\n");
}
if (main_session == NULL) {
/*
* Diagnose snmp_open errors with the input
* netsnmp_session pointer.
*/
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS)) {
char buf[1024];
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
snprintf(buf, sizeof(buf), "Warning: "
"Failed to connect to the agentx master agent
(%s)",
sess.peername);
netsnmp_sess_log_error(LOG_WARNING, buf, &sess);
} else {
snprintf(buf, sizeof(buf), "Error: "
"Failed to connect to the agentx master agent
(%s)",
sess.peername);
snmp_sess_perror(buf, &sess);
}
}
i get "Failed to connect to the agentx master agent" message
so what may be the problem ?
one more thing i understand that
if (session->flags & SNMP_FLAGS_STREAM_SOCKET)
this condition always get executed to true part of above if
so when i set udp in
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,NETSNMP_DS_AGENT_X_SOCKET,
"udp:localhost:705");
or
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET,
"tcp:localhost:705");
it always execute true part of if i.e for TCP case
What is the problem here ?
Thanks in advance
Regards
Bhushan E. Sonawane
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders