Skip to content

Commit

Permalink
[snmp]: Reduce Calls to SONiC Cfggen (sonic-net#5166)
Browse files Browse the repository at this point in the history
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to once calle during snmp startup

singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
  • Loading branch information
tahmed-dev authored and santhosh-kt committed Feb 25, 2021
1 parent 69869fa commit e1b1568
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dockers/docker-snmp/start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/usr/bin/env bash

mkdir -p /etc/ssw
sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sysDescription.j2 > /etc/ssw/sysDescription
mkdir -p /etc/ssw /etc/snmp

mkdir -p /etc/snmp
sonic-cfggen -d -y /etc/sonic/snmp.yml -t /usr/share/sonic/templates/snmpd.conf.j2 > /etc/snmp/snmpd.conf
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

0 comments on commit e1b1568

Please sign in to comment.