summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-09-01 14:48:06 +0200
committerChristian Poessinger <christian@poessinger.com>2018-09-01 14:48:06 +0200
commitbfde18e1064d0622d1eb022ffca2fa9a95bace0f (patch)
tree1f7be099c24e2b571c86715c85e4c499a578abce
parentbd2f3a42ec9fafdd133d78faa385a19a656f7240 (diff)
downloadvyos-1x-bfde18e1064d0622d1eb022ffca2fa9a95bace0f.tar.gz
vyos-1x-bfde18e1064d0622d1eb022ffca2fa9a95bace0f.zip
snmp.py: bugfix - CLI client community node was not processed
-rwxr-xr-xsrc/conf_mode/snmp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py
index 86a10c496..ef5db4690 100755
--- a/src/conf_mode/snmp.py
+++ b/src/conf_mode/snmp.py
@@ -270,6 +270,7 @@ def get_config():
if conf.exists('community {0} authorization'.format(name)):
community['authorization'] = conf.return_value('community {0} authorization'.format(name))
+ # Subnet of SNMP client(s) allowed to contact system
if conf.exists('community {0} network'.format(name)):
for addr in conf.return_values('community {0} network'.format(name)):
if vyos.validate.is_ipv4(addr):
@@ -277,6 +278,14 @@ def get_config():
else:
community['network_v6'].append(addr)
+ # IP address of SNMP client allowed to contact system
+ if conf.exists('community {0} client'.format(name)):
+ for addr in conf.return_values('community {0} client'.format(name)):
+ if vyos.validate.is_ipv4(addr):
+ community['network_v4'].append(addr)
+ else:
+ community['network_v6'].append(addr)
+
snmp['communities'].append(community)
if conf.exists('contact'):