Hi,

I'm having problems processing traps in my management application, After 
looking through the snmptrapd code I've added calls to
netsnmp_transport_open_server(app_name, "udp:162");
and then initialise a session with
snmp_sess_init
with the following initialisation
     session_p->peername = SNMP_DEFAULT_PEERNAME;  /* Original code had 
NULL here */
     session_p->version = SNMP_DEFAULT_VERSION;
     session_p->community_len = SNMP_DEFAULT_COMMUNITY_LEN;
     session_p->retries = SNMP_DEFAULT_RETRIES;
     session_p->timeout = SNMP_DEFAULT_TIMEOUT;
     session_p->callback = snmp_input;
     session_p->callback_magic = (void *) transport_trap_server_p;
     session_p->authenticator = NULL;
     session_p->isAuthoritative = SNMP_SESS_UNKNOWNAUTH;

which sets up the callback snmp_input.
then snmp_add to add the session to the opened transport server.

In snmp_input I have a printf to make sure that the routine is getting 
called that will output the operation_id value.

Then using snmptrap or snmpinform send the trap, e.g.
snmpinform -v2c -c public localhost "" 
PO-RECTIFIER-TEST-MIB::alarmMajorHighBattVoltTrapPO PO-RECTIFIER-TEST-M
IB::alarmMajorHighBattVoltPO.0 i 1
snmpinform: Timeout

with no success.

Is it ok to use snmpinform/trap with localhost and will the code above 
receive the trap PDU on localhost?
My application runs as a process that waits for commands to arrive over 
a socket so it will be blocked, would this cause problems?
Any other ideas/things to try out?

Many Thanks in advance,
Martin.









------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
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