diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-01-06 07:03:27 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-01-06 07:03:27 -0800 |
commit | 06e6b9a04619d5b14ae22186c75e87198ab7d425 (patch) | |
tree | ac70e6e6a6b91f7557f548091e8ca7c5c3e42687 | |
parent | 27b590effaeb016bb6bbbf28651d45ceef0ed9b0 (diff) | |
download | vyatta-cfg-quagga-06e6b9a04619d5b14ae22186c75e87198ab7d425.tar.gz vyatta-cfg-quagga-06e6b9a04619d5b14ae22186c75e87198ab7d425.zip |
Updates to SNMP link state trap
Bug 3811, 3806
Poll more frequently for link state traps and include more information.
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index 80276043..5c8df10c 100644 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -88,7 +88,7 @@ sub snmp_get_constants { print "sysDescr Vyatta $version\n"; print "sysObjectID 1.3.6.1.4.1.30803\n"; print "sysServices 14\n"; - print "smuxpeer .1.3.6.1.4.1.3317.1.2.2\n"; # ospfd + print "smuxpeer .1.3.6.1.4.1.3317.1.2.2\n"; # ospfd print "smuxpeer .1.3.6.1.4.1.3317.1.2.5\n"; # bgpd print "smuxpeer .1.3.6.1.4.1.3317.1.2.3\n"; # ripd print "smuxsocket localhost\n"; @@ -158,23 +158,26 @@ sub snmp_get_values { } my @trap_targets = $config->returnValues("trap-target"); - if ($#trap_targets >= 0) { - # linkUpDownNotifications configure the Event MIB tables to monitor + if (@trap_targets) { + # linkUp/Down configure the Event MIB tables to monitor # the ifTable for network interfaces being taken up or down # for making internal queries to retrieve any necessary information - # a snmpv3 user needs to be created - # we write appropriate values to /var/lib/snmp/snmpd.conf - # and /usr/share/snmp/snmpd.conf - #create an internal snmpv3 user of the form 'vyattaxxxxxxxxxxxxxxxx' + # create an internal snmpv3 user of the form 'vyattaxxxxxxxxxxxxxxxx' my $vyatta_user = "vyatta" . randhex(16); snmp_create_snmpv3_user($vyatta_user); snmp_write_snmpv3_user($vyatta_user); print "iquerySecName $vyatta_user\n"; - # code to activate link up down traps - print "linkUpDownNotifications yes\n"; + # Modified from the default linkUpDownNotification + # to include more OIDs and poll more frequently + print <<EOF; +notificationEvent linkUpTrap linkUp ifIndex ifDescr ifType ifAdminStatus ifOperStatus +notificationEvent linkDownTrap linkDown ifIndex ifDescr ifType ifAdminStatus ifOperStatus +monitor -r 10 -e linkUpTrap "Generate linkUp" ifOperStatus != 2 +monitor -r 10 -e linkDownTrap "Generate linkDown" ifOperStatus == 2 +EOF } foreach my $trap_target (@trap_targets) { |