Skip to content

Commit b6c9614

Browse files
authored
[SNMP] Fix config template issue when setting snmpagentaddress (#20152)
Related to PR#16187 Why I did it When you configure an SNMP agent address with a VRF, the snmpd service will fail to properly start after the configuration has been applied. The snmpd service shows a status of "FATAL." sudo config snmpagentaddress add 1.1.1.1 -p 161 -v mgmt docker exec -it snmp supervisorctl status | awk '{print $1, $2}' dependent-startup RUNNING rsyslogd RUNNING snmp-subagent STOPPED snmpd FATAL start EXITED supervisor-proc-exit-listener RUNNING Work item tracking Microsoft ADO (number only): How I did it Corrected syntax in the jinja template used to generate the snmpd.conf within the SNMP docker container. How to verify it sudo config snmpagentaddress add 1.1.1.1 -p 161 -v mgmt docker exec -it snmp supervisorctl status | awk '{print $1, $2}' dependent-startup EXITED rsyslogd RUNNING snmp-subagent RUNNING snmpd RUNNING start EXITED supervisor-proc-exit-listener RUNNING
1 parent b66bfc0 commit b6c9614

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dockers/docker-snmp/snmpd.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
{% if SNMP_AGENT_ADDRESS_CONFIG %}
2828
{% for (agentip, port, vrf) in SNMP_AGENT_ADDRESS_CONFIG %}
29-
agentAddress {{ protocol(agentip) }}:[{{ agentip }}]{% if port %}:{{ port }}{% endif %}{% if vrf %}%{{ vrf }}{% endif %}{{ "" }}
29+
agentAddress {{ protocol(agentip) }}:[{{ agentip }}]{% if vrf %}@{{ vrf }}{% endif %}{% if port %}:{{ port }}{% endif %}{{ "" }}
3030
{% endfor %}
3131
{% else %}
3232
agentAddress udp:161

0 commit comments

Comments
 (0)