-
Notifications
You must be signed in to change notification settings - Fork 1.8k
updated to support snmp config from redis configdb #6134
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
Merged
lguohan
merged 11 commits into
sonic-net:master
from
tsvanduyn:tsvanduy/snmpd_jinja2_update
Jan 5, 2021
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fb02a02
updated to support snmp config from redis configdb
98aca9d
updated for cases when configdb is empty
f227173
updated per PR comments
df113e1
updated snmp jinja2 file to use ConfigDB as main source and snmp.yml …
4712476
updated to add new changes
0b749eb
updated jinja file to get info from only configdb. The snmp.yml file…
fabc562
removing snmp.yml file from SONIC_CFGGEN_ARGS as it was already picke…
def1c15
updated to check if SNMP location and contact are not configured
e05110f
removed unneeded else per PR comments
fbe5d36
updated to removed unneeded 'else' in template
9b1d597
updated jinja template to fix spacing issues and update else to be el…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,30 @@ rocommunity6 {{ community }} | |
| rocommunity {{ snmp_rocommunity }} | ||
| rocommunity6 {{ snmp_rocommunity }} | ||
| {% endif %} | ||
|
|
||
| {% if snmp_rwcommunities is defined %} | ||
| {% for community in snmp_rwcommunities %} | ||
| rwcommunity {{ community }} | ||
| rwcommunity6 {{ community }} | ||
| {% endfor %} | ||
| {% elif snmp_rwcommunity is defined %} | ||
| rwcommunity {{ snmp_rwcommunity }} | ||
| rwcommunity6 {{ snmp_rwcommunity }} | ||
| {% else %} | ||
| {% endif %} | ||
|
|
||
| {% if SNMP_USER is defined %} | ||
tsvanduyn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {% for user in SNMP_USER %} | ||
| {% if SNMP_USER[user]['SNMP_USER_PERMISSION'] == 'RO' %} | ||
| rouser {{ user }} {{ SNMP_USER[user]['SNMP_USER_TYPE'] }} | ||
| CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }} | ||
tsvanduyn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {% else %} | ||
tsvanduyn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| rwuser {{ user }} {{ SNMP_USER[user]['SNMP_USER_TYPE'] }} | ||
| CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% else %} | ||
| {% endif %} | ||
|
|
||
| ############################################################################### | ||
tsvanduyn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # | ||
|
|
@@ -52,7 +76,11 @@ rocommunity6 {{ snmp_rocommunity }} | |
| # Note that setting these values here, results in the corresponding MIB objects being 'read-only' | ||
| # See snmpd.conf(5) for more details | ||
| sysLocation {{ snmp_location }} | ||
| {% if SNMP_CONTACT is defined %} | ||
| sysContact {{ SNMP.CONTACT.keys()[0] }} {{ SNMP.CONTACT.values()[0] }} | ||
tsvanduyn marked this conversation as resolved.
Show resolved
Hide resolved
tsvanduyn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {% else %} | ||
| sysContact Azure Cloud Switch vteam <[email protected]> | ||
tsvanduyn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {% endif %} | ||
| # Application + End-to-End layers | ||
| sysServices 72 | ||
|
|
||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.