Re: sending trap from subagent

"[email protected]" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
As I was looking at some forums with the same problem,I am also building subagent as a .so and running netsnmp version 5.4.2.1

[ connect() failing for some reasonWarning: Failed to connect to the agentx master agent (tcp:localhost:705):]
I hope someone has some 'aha' moments ..
Usha
--- On Sun, 4/15/12, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: Re: sending trap from subagent
To: "Dave Shield" <[email protected]>
Cc: [email protected]
Date: Sunday, April 15, 2012, 4:30 AM

After more poking found that subagent is not getting started.Warning: Failed to connect to the agentx master agent (tcp:localhost:705):
But not sure why I am getting that error.
netstat -a show tcp localhost 705 LISTENso agentx is surely running.
my subagent code:
  logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_FILE, 				     LOG_DEBUG);  if (logh)  {    logh->pri_max = LOG_EMERG;    logh->token = strdup("/var/log/subagent.log");  }
  snmp_disable_stderrlog();  snmp_enable_filelog("/var/log/subagent.log", 0);
  snmp_log(LOG_DEBUG, "TEST Starting the SNMP Subagent...\n");
  /* make us a agentx client. */  ret = netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, 			       NETSNMP_DS_AGENT_ROLE, 			       1);
  SOCK_STARTUP;
 
 netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,			NETSNMP_DS_AGENT_X_SOCKET,			"tcp:localhost:705");
  /* initialize the agent library */  ret = init_agent(daemon_name);  if (ret != 0)  {    goto handle_error;  }
  /* example-demon will be used to read example-demon.conf files. */  init_snmp(daemon_name);
cat /var/log/subagent.log  TEST Starting the SNMP Subagent...Warning: Failed to connect to the agentx master agent (tcp:localhost:705): 
Please help
Thank you--- On Sat, 4/14/12, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: Re: sending trap from subagent
To: "Dave Shield" <[email protected]>
Cc: [email protected]
Date: Saturday, April 14, 2012, 4:11 PM

snmpd_m.conf  is the conf file for the master.I am starting the master with the following parameters:/usr/sbin/snmpd -f -C -D -Dagentx -p
 /var/run/snmpd_m.pid -c /etc/snmp/snmpd_m.conf &>>/tmp/snmpd_m.log
Am I doing something wrong in the subagent? I dont see anything in the master log (snmpd_m.log except the following)
o log handling enabled - turning on stderr loggingregistered debug token agentx, 1agentx_register_app_config_handler: registering .conf token
 for "agentxsocket"agentx_register_app_config_handler: registering .conf token for "agentxperms"agentx_register_app_config_handler: registering .conf token for "agentxRetries"agentx_register_app_config_handler: registering .conf token for "agentxTimeout"Turning on AgentX master support.agentx/config: port spec: tcp:localhost:705agentx/master: initializing...agentx/master: initializing...   DONENET-SNMP version 5.4.2.1Reconfiguring daemonNET-SNMP version 5.4.2.1 restarted/etc/snmp/snmpd_mgmt.conf: line 1: Warning: The separate port argument to trapsink2 is deprecatedTurning on AgentX master support.agentx/config: port spec: tcp:localhost:705agentx/master: unexpected callback op 4
Also I dont have any subagent conf file. 
Thank
 you
--- On Sat, 4/14/12, Dave Shield <[email protected]> wrote:

From: Dave Shield <[email protected]>
Subject: Re: sending trap from subagent
To: "[email protected]" <[email protected]>
Cc: [email protected]
Date: Saturday, April 14, 2012, 2:24 PM

On 14 April 2012 05:37, [email protected] <[email protected]> wrote:
> I only need sending trap
 support to the list configured in conf file

> Contents of snmpd_m.conf :
> trap2sink x.x.x.x public 162

An AgentX subagent will pass all traps on to the master agent.
So the 'trap2sink' directive would need to be in the main snmpd.conf
file,  not the subagent's config file.


Dave

-----Inline Attachment Follows-----

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
-----Inline Attachment Follows-----

_______________________________________________
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

-----Inline Attachment Follows-----

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
-----Inline Attachment Follows-----

_______________________________________________
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

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2

_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.