-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated to support snmp config from redis configdb #6134
updated to support snmp config from redis configdb #6134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please also check with other reviewers.
…on if it does not exist in the ConfigDB
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
retest this please |
**- 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 <trvanduy@microsoft.com>
- 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)