updated to support snmp config from redis configdb#6134
Merged
lguohan merged 11 commits intosonic-net:masterfrom Jan 5, 2021
Merged
updated to support snmp config from redis configdb#6134lguohan merged 11 commits intosonic-net:masterfrom
lguohan merged 11 commits intosonic-net:masterfrom
Conversation
qiluo-msft
reviewed
Dec 8, 2020
qiluo-msft
reviewed
Dec 8, 2020
qiluo-msft
reviewed
Dec 8, 2020
qiluo-msft
reviewed
Dec 8, 2020
qiluo-msft
previously approved these changes
Dec 11, 2020
Collaborator
qiluo-msft
left a comment
There was a problem hiding this comment.
LGTM. Please also check with other reviewers.
…on if it does not exist in the ConfigDB
Contributor
Author
|
Updated Jinja2 snmpd.conf.j2 template to use ConfigDB as the main source and only fall back to snmp.yml if a particular community does not exist in the ConfigDB. This allows us to use both but eventually when we cutover to only using ConfigDB this will just work. |
qiluo-msft
reviewed
Dec 12, 2020
qiluo-msft
reviewed
Dec 12, 2020
added 4 commits
December 29, 2020 10:42
Merge branch 'master' into tsvanduy/snmpd_jinja2_update
…will already be add via the snmp_yml_to_configdb.py
…d up via snmp_yml_to_configdb.py
qiluo-msft
reviewed
Dec 31, 2020
qiluo-msft
reviewed
Dec 31, 2020
qiluo-msft
reviewed
Dec 31, 2020
qiluo-msft
reviewed
Dec 31, 2020
qiluo-msft
reviewed
Dec 31, 2020
qiluo-msft
approved these changes
Jan 4, 2021
SuvarnaMeenakshi
approved these changes
Jan 5, 2021
Contributor
Author
|
retest this please |
qiluo-msft
pushed a commit
that referenced
this pull request
Dec 13, 2021
**- Why I did it** I'm updating the jinja2 template to support getting SNMP information from the redis configdb. I'm using the format approved here: sonic-net/SONiC#718 This will pave the way for us to decrement using the snmp.yml in the future. Right now we will still be using both the snmp.yml and configdb to get variable information in order to create the snmpd.conf via the sonic-cfggen tool. **- How I did it** I first updated the SNMP Schema in PR #718 to get that approved as a standardized format. Then I verified I could add snmp configs to the configdb using this standard schema. Once the configs were added to the configdb then I updated the snmpd.conf.j2 file to support the updates via the configdb while still using the variables in the snmp.yml file in parallel. This way we will have backward compatibility until we can fully migrate to the configdb only. By updating the snmpd.conf.j2 template and running the sonic-cfggen tool the snmpd.conf gets generated with using the values in both the configdb and snmp.yml file. Co-authored-by: trvanduy <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- Why I did it
I'm updating the jinja2 template to support getting SNMP information from the redis configdb.
I'm using the format approved here:
sonic-net/SONiC#718
This will pave the way for us to decrement using the snmp.yml in the future.
Right now we will still be using both the snmp.yml and configdb to get variable information in order to create the snmpd.conf via the sonic-cfggen tool.
- How I did it
I first updated the SNMP Schema in PR #718 to get that approved as a standardized format.
Then I verified I could add snmp configs to the configdb using this standard schema. Once the configs were added to the configdb then I updated the snmpd.conf.j2 file to support the updates via the configdb while still using the variables in the snmp.yml file in parallel. This way we will have backward compatibility until we can fully migrate to the configdb only.
By updating the snmpd.conf.j2 template and running the sonic-cfggen tool the snmpd.conf gets generated with using the values in both the configdb and snmp.yml file.
- How to verify it
That will generate a new snmpd.conf file that the system will use for access via snmp.
SAMPLE CONFIGDB Configs:
SNMPv2 Community Configs:
SNMPv3 User Configs:
These configs were put into the configdb.
Here is what we have in the snmp.yml file
Using what we have in the snmp.yml file and what we have in the configdb this allows us to use sonic-cfggen tool to reference the snmp.conf.j2 file to create the snmpd.conf file.
The snmpd.conf file shows this after generation:
Then to verify this worked I ran some snmpwalk's to the device:
- Which release branch to backport (provide reason below if selected)
I'm not sure on this part. I know the whole reason for this is so we can get to the point where we are automation snmp community string rotation. I'll need to discuss this with you further.
- Description for the changelog
Update snmp.conf.j2 to support getting variable from configDB.
- A picture of a cute animal (not mandatory but encouraged)