From 06e6b9a04619d5b14ae22186c75e87198ab7d425 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 6 Jan 2010 07:03:27 -0800 Subject: Updates to SNMP link state trap Bug 3811, 3806 Poll more frequently for link state traps and include more information. --- scripts/snmp/vyatta-snmp.pl | 21 ++++++++++++--------- 1 file 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 <