--===============0212282354==
Content-Type: multipart/alternative;
boundary="----=_Part_23984_6697601.1165408446487"

------=_Part_23984_6697601.1165408446487
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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,NE TSNMP_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

------=_Part_23984_6697601.1165408446487
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hello friends
for finding reason for this failure i found that
follo=
wing function get call when i call init_agent
init_agent
|--subagent_=
pre_init
          &nb=
sp;     |--agentx_reopen_session
   &=
nbsp;           &nbs=
p;            |--sub=
agent_open_master_session

           &nbsp=
;            &n=
bsp;           |---snmp_o=
pen_ex
          &nbsp=
;            &n=
bsp;           &nbsp=
;           |---snmp_sess=
_open
           =
            &nb=
sp;            =
            &nb=
sp;      |-- _sess_open
   &nbsp=
;            &n=
bsp;           &nbsp=
;            &n=
bsp;           &nbsp=
;           |---netsnmp_tdomain_transpor=
t

netsnmp_tdomain_transport called as follows
slp->transport =3D ne=
tsnmp_tdomain_transport
& this netsnmp_tdomain_transport function fa=
ils it returns NULL
because of this session not get completed & so =
by this flow of code

if (main_session =3D=3D NULL) {
    printf("\n F=
ailure snmp_open_ex\n\n");
    }
  &nbs=
p; if (main_session =3D=3D NULL) {
      &=
nbsp; /*
         * Diagnose snm=
p_open errors with the input
       &=
nbsp; * netsnmp_session pointer. =20

         */
  &nbs=
p;     if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATI=
ON_ID, NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS)) {
   &nb=
sp;        char buf[1024];
 &nbs=
p;          if (!netsnmp_ds_ge=
t_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {

           &nbsp=
;    snprintf(buf, sizeof(buf), "Warning: "
&nb=
sp;            =
            "Fa=
iled to connect to the agentx master agent (%s)",
  &nbsp=
;            &n=
bsp;         sess.peername);
&nb=
sp;            =
   netsnmp_sess_log_error(LOG_WARNING, buf, &sess);

            } el=
se {
           &=
nbsp;    snprintf(buf, sizeof(buf), "Error: "
&=
nbsp;           &nbs=
p;            "=
Failed to connect to the agentx master agent (%s)",
  &nb=
sp;            =
          sess.peername
);
           &nb=
sp;    snmp_sess_perror(buf, &sess);
  &nbs=
p;         }
   &=
nbsp;    }
       
> i get "Failed to connect to the agentx master agent" messa=
ge
so what may be the problem ?
one more thing i understand that=20

if (session->flags & SNMP_FLAGS_STREAM_SOCKET)
this conditio=
n always get executed to true  part of above if
so when i set udp =
in
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,NE TSNMP_DS_AGENT_X_SO=
CKET, "udp:localhost:705");

or
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGEN=
T_X_SOCKET, "tcp:localhost:705");

it always execute true part of if i.e for  TCP case
What is th=
e problem here ?

Thanks in advance
Regards
Bhushan E. Sonawane=




------=_Part_23984_6697601.1165408446487--


--===============0212282354==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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?p...rge&CID=DEVDEV
--===============0212282354==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0212282354==--