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 | |
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.
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 12 | ||||
-rw-r--r-- | templates/service/snmp/trap-target/node.def | 2 | ||||
-rw-r--r-- | templates/service/snmp/trap-target/node.tag/community/node.def | 2 | ||||
-rw-r--r-- | templates/service/snmp/trap-target/node.tag/port/node.def | 2 |
4 files changed, 14 insertions, 4 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"; } } diff --git a/templates/service/snmp/trap-target/node.def b/templates/service/snmp/trap-target/node.def index c041d108..493484b7 100644 --- a/templates/service/snmp/trap-target/node.def +++ b/templates/service/snmp/trap-target/node.def @@ -1,3 +1,3 @@ -multi: +tag: type: ipv4 help: Set IP address of trap target diff --git a/templates/service/snmp/trap-target/node.tag/community/node.def b/templates/service/snmp/trap-target/node.tag/community/node.def new file mode 100644 index 00000000..dceff369 --- /dev/null +++ b/templates/service/snmp/trap-target/node.tag/community/node.def @@ -0,0 +1,2 @@ +type: txt +help: set community used when sending trap information diff --git a/templates/service/snmp/trap-target/node.tag/port/node.def b/templates/service/snmp/trap-target/node.tag/port/node.def new file mode 100644 index 00000000..4a79e794 --- /dev/null +++ b/templates/service/snmp/trap-target/node.tag/port/node.def @@ -0,0 +1,2 @@ +type: u32 +help: Set destination port used for trap notification |