diff options
author | rbalocca <rbalocca@vyatta.com> | 2008-03-22 18:04:15 -0700 |
---|---|---|
committer | rbalocca <rbalocca@vyatta.com> | 2008-03-22 18:04:15 -0700 |
commit | 9c7c83a5e701f7efcee11f7ce46361f841dc29b6 (patch) | |
tree | fd1b505390d3c19441767de2ac7678fb11a63e17 /scripts/snmp/vyatta-snmp.pl | |
parent | 4f86a2a56c09f0731e401aa2fe0ae5717f7830c1 (diff) | |
parent | f279d69e1d3952de1231ecf56d6ebb3023b96645 (diff) | |
download | vyatta-cfg-quagga-9c7c83a5e701f7efcee11f7ce46361f841dc29b6.tar.gz vyatta-cfg-quagga-9c7c83a5e701f7efcee11f7ce46361f841dc29b6.zip |
Merge branch 'glendale' into hollywood
Conflicts:
debian/control
scripts/install-system
scripts/rl-system.init
Diffstat (limited to 'scripts/snmp/vyatta-snmp.pl')
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index f12bcc45..0301a041 100644 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -74,12 +74,37 @@ sub snmp_get_values { my @communities = $config->listNodes(); foreach my $community (@communities) { - my $authorization = $config->returnValue("$community authorization"); - if (defined $authorization and $authorization eq "rw") { - $output .= "rwcommunity $community\n"; - } else { - $output .= "rocommunity $community\n"; - } + my $authorization = $config->returnValue("$community authorization"); + my @clients = $config->returnValues("$community client"); + my @networks = $config->returnValues("$community network"); + + if (scalar(@clients) == 0 and scalar(@networks) == 0){ + if (defined $authorization and $authorization eq "rw") { + $output .= "rwcommunity $community\n"; + } else { + $output .= "rocommunity $community\n"; + } + } else { + if (scalar(@clients) != 0){ + foreach my $client (@clients){ + if (defined $authorization and $authorization eq "rw") { + $output .= "rwcommunity $community $client\n"; + } else { + $output .= "rocommunity $community $client\n"; + } + } + } + if (scalar(@networks) != 0){ + foreach my $network (@networks){ + if (defined $authorization and $authorization eq "rw") { + $output .= "rwcommunity $community $network\n"; + } else { + $output .= "rocommunity $community $network\n"; + } + + } + } + } } $config->setLevel("protocols snmp"); |