diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-01-07 17:21:23 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-01-07 17:44:28 -0800 |
commit | 732f072d22e3e75f7fc8c0b5b6c601a81c0c88ae (patch) | |
tree | aea863442322d9ca7de5014ec213611eb8df8a6a /scripts | |
parent | 94fff914186c80b5d310fc9296d83726e5de1f29 (diff) | |
download | vyatta-cfg-system-732f072d22e3e75f7fc8c0b5b6c601a81c0c88ae.tar.gz vyatta-cfg-system-732f072d22e3e75f7fc8c0b5b6c601a81c0c88ae.zip |
Add support for trap community and port
Bug 3756
Allow setting trap communities and port values.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index 5c8df10c..9a6a5039 100644 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -157,8 +157,7 @@ sub snmp_get_values { print "syslocation \"$location\" \n"; } - my @trap_targets = $config->returnValues("trap-target"); - + my @trap_targets = $config->listNodes("trap-target"); if (@trap_targets) { # linkUp/Down configure the Event MIB tables to monitor # the ifTable for network interfaces being taken up or down @@ -181,7 +180,14 @@ EOF } foreach my $trap_target (@trap_targets) { - print "trap2sink $trap_target\n"; + my $port = $config->returnValue("trap-target $trap_target port"); + my $community + = $config->returnValue("trap-target $trap_target community"); + + print "trap2sink $trap_target"; + print ":$port" if $port; + print " %community" if $community; + print "\n"; } } |