Hello,

  I'm using the send_linkUpDownNotifications() to generate a trap when
I got some information from the netlink system.  When pulling an
eth cable I thus get the following trap (note that the Admin and Oper
values ares test values) :

9:41:10 TRAP:Cold Start from UDP: [10.159.9.37]:41278 TRAP2, SNMP v2c, 
community public 
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (255210) 0:42:32.10 
SNMPv2-MIB::snmpTrapOID.0 = OID: 
IF-MIB::linkUp 
IF-MIB::ifIndex.5 = INTEGER: 5 
IF-MIB::ifAdminStatus.5 = INTEGER: 30 
IF-MIB::ifOperStatus.5 = INTEGER: 50 
SNMPv2-MIB::snmpTrapEnterprise.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10

Why is this trap a Cold Start trap ?  Is this normal ? I'm also
wondering why it is a disman event field.

The trap is generated in the following way:

snmpd.conf has commented: 
#linkUpDownNotifications yes

agnetlink is a new module that does:

1) 
 
void init_agnetlink(void) 
{ 
  // wait somewhat for system to stabilize 
  snmp_alarm_register(5, 0, (void*) registerSocket, NULL);  
} 
 
2) 
 
result = register_readfd(nlfd, (void*) processNetlinkMessage, (void*) nlfd); 
(some checking if it failed - it does succeed) 
 
3) Pull/plug the eth2 cable, get a netlink msg 
 
(some error checking on msg size received from netlink) 
 
nlhdr = (struct nlmsghdr *)(msghdr.msg_iov->iov_base); 
ifh = (struct ifinfomsg *)((unsigned char *) nlhdr + NLMSG_HDRLEN); 
 
// test values only 
adminStatus = 30; 
operStatus = 50; 
 
oid notification_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 4 }; 
 
send_linkUpDownNotifications(notification_oid, 
          OID_LENGTH(notification_oid), 
          ifh->ifi_index, 
          adminStatus, 
          operStatus); 
 
The trap that is received (within about 1 or 2 seconds) on such 
events.



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to