sonic-buildimage icon indicating copy to clipboard operation
sonic-buildimage copied to clipboard

[master][SNMP] Fix config template issue when setting snmpagentaddress

Open brholmes1 opened this issue 1 year ago • 1 comments

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

Which release branch to backport (provide reason below if selected)

  • [ ] 201811
  • [ ] 201911
  • [ ] 202006
  • [ ] 202012
  • [ ] 202106
  • [ ] 202111
  • [ ] 202205
  • [ ] 202211
  • [ ] 202305
  • [x] 202311
  • [x] 202405

Tested branch (Please provide the tested image version)

  • [x] SONiC.master.634739-2ff111cb9
  • [x] SONiC.202405.565256-4d6d808b8
  • [x] SONiC-OS-202311.634628-3cc3e1a11

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

brholmes1 avatar Sep 05 '24 17:09 brholmes1

@qiluo-msft Can you please help review? Thanks!

brholmes1 avatar Oct 01 '24 16:10 brholmes1

@SuvarnaMeenakshi Can you please review and sign-off?

dgsudharsan avatar Jan 08 '25 05:01 dgsudharsan

@brholmes1 , Can you please check checkers failure ? and also comment on the review ?

dprital avatar Feb 11 '25 08:02 dprital

/azpw run Azure.sonic-buildimage

brholmes1 avatar Feb 12 '25 17:02 brholmes1

/AzurePipelines run Azure.sonic-buildimage

mssonicbld avatar Feb 12 '25 17:02 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 12 '25 17:02 azure-pipelines[bot]

Approved, requesting to add a sonic-mgmt test for this.

SuvarnaMeenakshi avatar Feb 19 '25 07:02 SuvarnaMeenakshi

@qiluo-msft , Can you please merge ?

dprital avatar Feb 19 '25 08:02 dprital

@brholmes1 can you please add the missing test coverage for this PR by raising another PR? Thanks!

gechiang avatar Feb 26 '25 16:02 gechiang

Yes, I will work on adding the missing test coverage and raise a new PR. Thanks!

brholmes1 avatar Feb 26 '25 16:02 brholmes1

@kperumalbfn Can you please help cherry-pick this fix to 202411?

dgsudharsan avatar Feb 27 '25 05:02 dgsudharsan

@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.

kperumalbfn avatar Feb 28 '25 17:02 kperumalbfn

Cherry-pick PR to 202411: https://github.com/sonic-net/sonic-buildimage/pull/21987

mssonicbld avatar Mar 11 '25 00:03 mssonicbld