|
RE: a mistake in file mib2c.notify.conf line 37 ??
From: Fernandez Pinas, David <dfernandezp@in...> - 2004-04-28 09:08
|
See the example notify.c at the NET-SNMP tutorial for some clues: http://= http://www.net-snmp.org/tutorial-5/agent/notification_8c-example.html > Then when i use the command mib2c -c mib2c.notify.conf=20 > cardStatusChange, > the system produces two files cardStatusChange.c=20 > cardStatusChange.h, and > i compile it to agent,but why i can't get the trap, following=20 > is the file, > thanks. >=20 > /* > * Note: this file originally auto-generated by mib2c using > * : mib2c.notify.conf,v 5.2 2003/06/26 09:27:41 dts12 Exp $ > */ > #include <net-snmp/net-snmp-config.h> > #include <net-snmp/net-snmp-includes.h> > #include <net-snmp/agent/net-snmp-agent-includes.h> > #include "cardStatusChange.h" >=20 > static oid snmptrap_oid[] =3D { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };= >=20 > int > send_cardStatusChange_trap(void) > { > netsnmp_variable_list *var_list =3D NULL; > oid cardStatusChange_oid[] =3D > { 1, 3, 6, 1, 4, 1, 596, 3, 4, 10, 2 }; > oid alarmSlotNo_oid[] =3D > { 1, 3, 6, 1, 4, 1, 596, 3, 4, 6, 4, 1, 2, /* insert=20 > index here */ > }; > oid eMux8000CardStatus_oid[] =3D > { 1, 3, 6, 1, 4, 1, 596, 3, 4, 3, 1, 9, /* insert=20 > index here */ }; > oid eMux8000ActualCardType_oid[] =3D > { 1, 3, 6, 1, 4, 1, 596, 3, 4, 3, 1, 8, /* insert=20 > index here */ }; >=20 > /* > * Set the snmpTrapOid.0 value > */ > snmp_varlist_add_variable(&var_list, > snmptrap_oid, OID_LENGTH(snmptrap_oid), > ASN_OBJECT_ID, > cardStatusChange_oid, > sizeof(cardStatusChange_oid)); >=20 > /* > * Add any objects from the trap definition > */ > snmp_varlist_add_variable(&var_list, > alarmSlotNo_oid,=20 > OID_LENGTH(alarmSlotNo_oid), > ASN_INTEGER, > /* > * Set an appropriate value for=20 > alarmSlotNo > */ > NULL, 0); > snmp_varlist_add_variable(&var_list, > eMux8000CardStatus_oid, > OID_LENGTH(eMux8000CardStatus_oid), > ASN_INTEGER, > /* > * Set an appropriate value for > eMux8000CardStatus > */ > NULL, 0); > snmp_varlist_add_variable(&var_list, > eMux8000ActualCardType_oid, > OID_LENGTH(eMux8000ActualCardType_oid), > ASN_INTEGER, > /* > * Set an appropriate value for > eMux8000ActualCardType > */ > NULL, 0); >=20 > /* > * Add any extra (optional) objects here > */ >=20 > /* > * Send the trap to the list of configured destinations > * and clean up > */ > send_v2trap(var_list); > snmp_free_varbind(var_list); >=20 > return SNMP_ERR_NOERROR; > } >=20 >=20 > Best Regards > chi-chien Liu >=20 -------------------------------------------------------------------------= ------------------------------------------ Este correo electr=F3nico y, en su caso, cualquier fichero anexo al mismo= , contiene informaci=F3n de car=E1cter confidencial exclusivamente dirigi= da a su destinatario o destinatarios. Queda prohibida su divulgaci=F3n, c= opia o distribuci=F3n a terceros sin la previa autorizaci=F3n escrita de = Indra. En el caso de haber recibido este correo electr=F3nico por error, = se ruega notificar inmediatamente esta circunstancia mediante reenv=EDo a= la direcci=F3n electr=F3nica del remitente. The information in this e-mail and in any attachments is confidential and= solely for the attention and use of the named addressee(s). You are here= by notified that any dissemination, distribution or copy of this communic= ation is prohibited without the prior written consent of Indra. If you ha= ve received this communication in error, please, notify the sender by rep= ly e-mail |
| Thread | Author | Date |
|---|---|---|
| RE: a mistake in file mib2c.notify.conf line 37 ?? | Fernandez Pinas, David <dfernandezp@in...> |