Thanks Robert,

I had Try your suggest.

I had modify the script "net-snmp-config" adding this line:
 netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
                          NETSNMP_DS_AGENT_X_SOCKET, "localhost:705");
and the generated subagent file is (netsnmptmp.2512.c):

                /* generated from net-snmp-config */
                #include <net-snmp/net-snmp-config.h>
                #ifdef HAVE_SIGNAL_H
                #include <signal.h>
                #endif /* HAVE_SIGNAL_H */
                #include <net-snmp/net-snmp-includes.h>
                #include <net-snmp/agent/net-snmp-agent-includes.h>
                static int keep_running;

                RETSIGTYPE
                stop_server(int a) {
                keep_running = 0;
                }

int
main (int argc, char **argv) {
/* print log errors to stderr */
snmp_enable_stderrlog();
/* we are a subagent */
netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET, "localhost:705");


                  /* initialize the agent library */
                  init_agent("mysubagent2");

                  /* initialize your mib code here */
                  init_test();

                  /* ustMain will be used to read ustMain.conf files. */
                  init_snmp("mysubagent2");

                  /* In case we recevie a request to stop (kill -TERM or kill 
-INT) */
                  keep_running = 1;
                #ifdef SIGTERM
                  signal(SIGTERM, stop_server);
                #endif
                #ifdef SIGINT
                  signal(SIGINT, stop_server);
                #endif

                  /* main loop here... */
                  while(keep_running) {
                    agent_check_and_process(1);
                  }

                  /* at shutdown time */
                  snmp_shutdown("mysubagent2");
                  exit(0);
                }


but the result is the same:

                test Initializing
                Error: Failed to connect to the agentx master agent: Unknown 
host
                select: No such file or directory
                select: No such file or directory
                select: No such file or directory
                ................................

Thanks,
Maurizio


From: Robert Story <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: "Maurizio RUBINI" <[EMAIL PROTECTED]>
CC: [email protected]
Subject: Re: AgentX problem on Win32 - MinGW
Date: Mon, 21 Feb 2005 12:05:29 -0500

On Mon, 21 Feb 2005 09:20:51 +0100 Maurizio wrote:
MR> I have a problem with agentx on MinGW.(Windows 2000)
MR> [...]
MR> Then I had start the deamon AgentX  "mysubagent" with the configuration
MR> file mysubagent.conf listed below:
MR> [...]
MR> agentxsocket localhost:705

I don't think this directive works in subagent conf files. Try the
netsnmp_ds_set_string example from this FAQ entry:

http://www.net-snmp.org/docs/FAQ.html#How_can_I_run_AgentX_with_a_different_socket_address_

--
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>


You are lost in a twisty maze of little standards, all different.




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to