-
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
changes to handle snmp configuration as per the modified CLI #3586
changes to handle snmp configuration as per the modified CLI #3586
Conversation
Hi @kannankvs, In your PR, for example,
Could you optimize code and submit another PR? #Closed |
fi | ||
|
||
echo -n "" > /tmp/snmpagentaddr.yml | ||
keys=`/usr/bin/redis-cli -n 4 keys "SNMP_AGENT_ADDRESS_CONFIG|*"` |
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.
/usr/bin/redis-cli -n 4 keys "SNMP_AGENT_ADDRESS_CONFIG|*" [](start = 10, length = 58)
Try prevent usage redis-cli keys *
because if will join keys by blanks without escaping. #Closed
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.
@qiluo-msft : These lines are not needed with the new PR4057 and hence the comment is ignored.
@qiluo-msft : A new PR4057 has been raised to address the same. Request you to kindly review it and provide the comments. |
While doing CLI changes for SNMP configuration, few changes are made in backend to handle the modified CLI.
** Changes**
Testing Done
Tested by configuring the SNMP listening IP as well as the trap server IP.
admin@sonic:
$ sudo config vrf add mgmt$ sudo config snmpagentaddress add 100.104.45.9 -v mgmtadmin@sonic:
admin@sonic:
$ sudo config snmptrap modify 3 100.94.212.7 -v mgmt$ sudo cat /etc/sonic/snmp.ymladmin@sonic:
snmp_rocommunity: public
snmp_location: public
v1_trap_dest: NotConfigured
v2_trap_dest: NotConfigured
v3_trap_dest: 100.94.212.7:162%mgmt public
snmp_agent_address_1: 100.104.45.9%mgmt
root@sonic:~# docker exec -it snmp bash
The file /etc/snmp/snmpd.conf inside snmp docker shows the following configuration which will be used by snmpd daemon.
Following %mgmt will be used by snmpd to listen to the IP 100.104.45.9 in "mgmt" vrf.
agentAddress 100.104.45.9%mgmt
Following %mgmt will be used by snmpd to send traps to the server 100.94.212.7 in "mgmt" vrf.
informsink 100.94.212.7:162%mgmt public