Hello all:

I am unable to get traps from an embedded subagent. I have a C++ application
that runs a module containing an embedded AgentX subagent. Though there are
other app-specific things going on in between, the following is the code
that relates to the embedded subagent. (I have verified that all of this
code is being run, in the order shown.)
--> agentSNMPAlert is the name of my application module that is the embedded
AgentX subagent. Also, the init_agentSNMPAlert() function is just
registering a few MIB objects that I am not yet using for anything...I am
just trying to get the traps to reach my NMS.

// During initialization function for the module:
snmp_enable_stderrlog();                      //  set up STDERR logging
netsnmp_ds_set_boolean(
   NETSNMP_DS_APPLICATION_ID,
   NETSNMP_DS_AGENT_ROLE,
   1);                                        //  set agent role in DS
netsnmp_ds_set_string(
   NETSNMP_DS_APPLICATION_ID,
   NETSNMP_DS_AGENT_X_SOCKET,
   "udp:localhost:705");                      //  set host:port for socket
init_agent("agentSNMPAlert");                 //  init agent library
init_agentSNMPAlert();                        //  run MIB module init
init_snmp("agentSNMPAlert");                  //  init SNMP library

// My subagent processing loop (gets started on its own thread)
while(!bSNMPShutdown){                          // While SNMP is running,
  agent_check_and_process(1);                   //  process SNMP gets/sets
}
snmp_shutdown("agentSNMPAlert");                // Shutdown the subagent
SOCK_CLEANUP;                                   // Clean up after socket

// My attempt to send a trap:
// (EGP neighbor loss is used so I can discern my trap for the
//  other cold start trap produced by the master agent on startup.)
// This call is made when the subagent should be up and running.
send_easy_trap(5, 0);                           // Send EGP neighbor loss

In my snmpd.conf file I have a "trapsink" defined to send me traps:
trapsink my.dotted.ip.address public 162

I do get the cold start trap from the Net-SNMP master agent, but not from my
embedded subagent. I have tried using the same trapsink line defined in
agentSNMPAlert.conf but it is causing some problem and I don't get the trap
from my embedded subagent either way??

This is the output that I get when the master agent is started with:
snmpd -Dagentx -mall

output:
No log handling enabled - turning on stderr logging
registered debug token agentx, 1
agentx_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"
/usr/local/share/snmp/agentSNMPAlert.conf: line 7: Warning: Unknown token:
trapsink.
/usr/local/share/snmp/agentSNMPAlert.conf: line 18: Warning: Unknown token:
trap2community.
net-snmp: 1 error(s) in config file(s)
/usr/local/share/snmp/snmpd.conf: line 11: Warning: Unknown token: agentx.
/usr/local/share/snmp/snmpd.conf: line 40: Warning: Unknown token:
trap2community.
net-snmp: 1 error(s) in config file(s)
NET-SNMP version 5.3.1

Thank you very much for your help on this!
David Arthur


-------------------------------------------------------------------------
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-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to