Dear Karthik,
As per our telephonic conversation, you have an issue in sending an
structure / pointer from the agent to the application because of
creation of agent.log file at the agent side. We suggest you to set the
Debug Mode to NONE instead of DEBUG in the config.h file which is
available in
<projctname>/agent/source/system/include/ directory.
i.e. define the Debug mode in the config.h file as mentioned below.
/* Debug mode (NONE/ERRMSG/DEBUG/TRACE). */
#define NONE
For sending traps to the agent , there is no need to send traps from
the external application to the agent. Instead , you can send some
unique string to the agent through the tcp socket created between the
agent and the application. In the agent, you should write a switch case
function for each case say (up/down/restart/etc ... ). and you have a
different varbind for each case.
In the agent, if the string matches with any one of the switch case (up
/ down / restart / etc ) , then you have to call the respective
sendv2Trapsof(scalar/tabular)Notifications() function. And in that
function, you have to add the varbind which is belongs to the
particular string ( up / down / restart / etc ... ) . The function
SendV2Trapsof(scalar/tabular)Notifications() trigger the traps to the
manager.
To add varbinds to the traps, please refer the below help document link.
The Traps sent out for a particular Trap definition will contain all
the VarBinds related to the variables contained in that Trap/Notification
definition. In addition to this if you wish to add extra VarBinds with
them, you can make use of the
extraVarbind
Vector parameter. For more information on this, please refer to
Adding
Extra Varbinds to Traps section.
http://www.adventnet.com/products/cagent/help/snmp/c_snmp_traps.html#addextravarbinds
Hope this helps. Do revert back to us for further support.
Thanks and Regards,
subarayan