Hell all, need help !!
Below are my two functions for trap generation...
Can anyone tell me how can I pass any external argument to this functions? I
want to use some external values that I can send with trap..Help Me..
And can anyone tell me what these two arguements are useful for it ??
-à int clientreg, void * clientreg
Any answer will b appreciated.
Thank you.
void cpu()
{
DEBUGMSGTL(("example_notification","initializing (setting callback
alarm)\n"))
snmp_alarm_register(30, /* seconds */
SA_REPEAT, /* repeat (every 30 seconds). */
send_highCpuUsage_trap, /* our callback */
NULL /* no callback data needed */
);
}
Void send_highCpuUsage_trap(unsigned int clientreg, void * clientreg)
{
netsnmp_variable_list *var_list = NULL;
oid highCpuUsage_oid[] = { 1,3,6,1,4,1,21067,3,1,4,1 };
oid snmptrap_oid[]={ 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
//int highCpuUsage=30;
/*
* Set the snmpTrapOid.0 value
*/
size_t highCpuUsage_oid_len=OID_LENGTH(highCpuUsage_oid);
snmp_varlist_add_variable(&var_list,
snmptrap_oid, OID_LENGTH(snmptrap_oid),
ASN_INTEGER,
(u_char *)&highCpuUsage, sizeof(highCpuUsage));
/*
* Add any extra (optional) objects here
*/
/*
* Send the trap to the list of configured destinations
* and clean up
*/
send_v2trap( var_list );
snmp_free_varbind( var_list );
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders