6efc0a885f
This PR is in preparation to move from snmp.yml to configdb. This will more closely align with other commands in sonic and use configdb as the source of truth for snmp configuration. Note: This is the first of 2 PR's to enable this. This PR will not change any functionality but will allow the snmp.yml file info to be put into the configdb. Created a script that takes the snmp.yml variables and converts them to the configdb format. Added file to dockerfile.j2 so that file is copied in the container. Updated start.sh file to automatically run the python conversion script each time the docker container is restarted.
31 lines
744 B
Bash
Executable File
31 lines
744 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
|
|
if [ "${RUNTIME_OWNER}" == "" ]; then
|
|
RUNTIME_OWNER="kube"
|
|
fi
|
|
|
|
CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py"
|
|
if test -f ${CTR_SCRIPT}
|
|
then
|
|
${CTR_SCRIPT} -f snmp -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION}
|
|
fi
|
|
|
|
mkdir -p /etc/ssw /etc/snmp
|
|
|
|
# Parse snmp.yml and insert the data in Config DB
|
|
/usr/bin/snmp_yml_to_configdb.py
|
|
|
|
SONIC_CFGGEN_ARGS=" \
|
|
-d \
|
|
-y /etc/sonic/sonic_version.yml \
|
|
-t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \
|
|
-y /etc/sonic/snmp.yml \
|
|
-t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \
|
|
"
|
|
|
|
sonic-cfggen $SONIC_CFGGEN_ARGS
|
|
|
|
mkdir -p /var/sonic
|
|
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
|