[SNMP] Fix config template issue when setting snmpagentaddress#20152
[SNMP] Fix config template issue when setting snmpagentaddress#20152qiluo-msft merged 1 commit intosonic-net:masterfrom
Conversation
The committers listed above are authorized under a signed CLA. |
7ff5ec6 to
0937e70
Compare
0937e70 to
8735dae
Compare
|
@qiluo-msft Can you please help review? Thanks! |
|
@SuvarnaMeenakshi Can you please review and sign-off? |
| {% if SNMP_AGENT_ADDRESS_CONFIG %} | ||
| {% for (agentip, port, vrf) in SNMP_AGENT_ADDRESS_CONFIG %} | ||
| agentAddress {{ protocol(agentip) }}:[{{ agentip }}]{% if port %}:{{ port }}{% endif %}{% if vrf %}%{{ vrf }}{% endif %}{{ "" }} | ||
| agentAddress {{ protocol(agentip) }}:[{{ agentip }}]{% if vrf %}@{{ vrf }}{% endif %}{% if port %}:{{ port }}{% endif %}{{ "" }} |
There was a problem hiding this comment.
@{{ vrf }} - should it be ip@vrf or ip%vrf ?
Do we need a sonic-mgmt test for this feature ?
There was a problem hiding this comment.
In my testing, ip%vrf would not resolve the issue. Using the ip@vrf format ultimately allowed for the VRF to be configured and is what I am using in my environment.
There was a problem hiding this comment.
@brholmes1 can you help add a sonic-mgmt test case for snmp with vrf?
…g snmpagentaddress (sonic-net#20152)
…g snmpagentaddress (sonic-net#20152)
|
@brholmes1 , Can you please check checkers failure ? and also comment on the review ? |
|
/azpw run Azure.sonic-buildimage |
|
/AzurePipelines run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Approved, requesting to add a sonic-mgmt test for this. |
|
@qiluo-msft , Can you please merge ? |
|
@brholmes1 can you please add the missing test coverage for this PR by raising another PR? |
|
Yes, I will work on adding the missing test coverage and raise a new PR. Thanks! |
|
@kperumalbfn Can you please help cherry-pick this fix to 202411? |
|
@brholmes1 could you add sonic-mgmt tests for this change and let us know. We will include that in 202411 as well. Since we are planning to stabilize 202411, will be good to have the tests included in 202411 as well. |
…-net#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
|
Cherry-pick PR to 202411: #21987 |
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."
Work item tracking
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
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)