Skip to content

Commit 9b1d597

Browse files
author
trvanduy
committed
updated jinja template to fix spacing issues and update else to be elif 'RW'
1 parent fbe5d36 commit 9b1d597

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dockers/docker-snmp/snmpd.conf.j2

+8-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ agentAddress udp6:161
3232
# system + hrSystem groups only
3333
view systemonly included .1.3.6.1.2.1.1
3434
view systemonly included .1.3.6.1.2.1.25.1
35+
3536
# Default access to basic system info
3637

38+
3739
{% if SNMP_COMMUNITY is defined %}
3840
{% for community in SNMP_COMMUNITY %}
3941
{% if SNMP_COMMUNITY[community]['TYPE'] == 'RO' %}
@@ -56,22 +58,24 @@ rwcommunity6 {{ community }}
5658
{% for user in SNMP_USER %}
5759
{% if SNMP_USER[user]['SNMP_USER_PERMISSION'] == 'RO' %}
5860
rouser {{ user }} {{ SNMP_USER[user]['SNMP_USER_TYPE'] }}
59-
CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }}
60-
{% else %}
61+
CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }}
62+
{% elif SNMP_USER[user]['SNMP_USER_PERMISSION'] == 'RW' %}
6163
rwuser {{ user }} {{ SNMP_USER[user]['SNMP_USER_TYPE'] }}
62-
CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }}
64+
CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }}
6365
{% endif %}
6466
{% endfor %}
6567
{% else %}
6668
{% endif %}
6769

70+
6871
###############################################################################
6972
#
7073
# SYSTEM INFORMATION
7174
#
7275

7376
# Note that setting these values here, results in the corresponding MIB objects being 'read-only'
7477
# See snmpd.conf(5) for more details
78+
7579
{% if SNMP is defined and SNMP.LOCATION is defined %}
7680
sysLocation {{ SNMP.LOCATION.Location }}
7781
{% else %}
@@ -82,6 +86,7 @@ sysContact {{ SNMP.CONTACT.keys()[0] }} {{ SNMP.CONTACT.values()[0] }}
8286
{% else %}
8387
sysContact Azure Cloud Switch vteam <linuxnetdev@microsoft.com>
8488
{% endif %}
89+
8590
# Application + End-to-End layers
8691
sysServices 72
8792

0 commit comments

Comments
 (0)