Skip to content

Commit cac1e17

Browse files
yejianquanVladimirKuk
authored andcommitted
[chassis-packet][SNMP] Enable SNMP dynamic frequency on packet chassis (sonic-net#21355)
Why I did it It's one part of the fixes of sonic-net#21314 SNMP walker request will always timeout when 100% CPU utilization. Work item tracking Microsoft ADO 30112399: How I did it Enable SNMP dynamic frequency on packet chassis. How to verify it snmp/test_snmp_cpu.py(https://github.com/sonic-net/sonic-mgmt/blob/master/tests/snmp/test_snmp_cpu.py) tests the scenario.
1 parent 0601b3a commit cac1e17

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

dockers/docker-snmp/Dockerfile.j2

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,15 @@ RUN apt-get -y purge \
6666
find / | grep -E "__pycache__" | xargs rm -rf && \
6767
rm -rf /debs /python-wheels ~/.cache
6868

69+
COPY ["docker-snmp-init.sh", "/usr/bin/"]
6970
COPY ["start.sh", "/usr/bin/"]
7071
COPY ["snmp_yml_to_configdb.py", "/usr/bin/"]
71-
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
7272
COPY ["*.j2", "/usr/share/sonic/templates/"]
7373
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
7474
COPY ["critical_processes", "/etc/supervisor"]
7575

7676
# Although exposing ports is not needed for host net mode, keep it for possible bridge mode
7777
EXPOSE 161/udp 162/udp
7878

79-
ENTRYPOINT ["/usr/local/bin/supervisord"]
79+
RUN chmod +x /usr/bin/docker-snmp-init.sh
80+
ENTRYPOINT ["/usr/bin/docker-snmp-init.sh"]
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
#Generate supervisord.conf based on device metadata
3+
mkdir -p /etc/supervisor/conf.d/
4+
sonic-cfggen -d -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
5+
exec /usr/local/bin/supervisord

dockers/docker-snmp/supervisord.conf dockers/docker-snmp/supervisord.conf.j2

+4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ dependent_startup=true
5050
dependent_startup_wait_for=start:exited
5151

5252
[program:snmp-subagent]
53+
{% if DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
54+
command=/usr/bin/env python3 -m sonic_ax_impl --enable_dynamic_frequency
55+
{% else %}
5356
command=/usr/bin/env python3 -m sonic_ax_impl
57+
{% endif %}
5458
priority=4
5559
autostart=false
5660
autorestart=false

0 commit comments

Comments
 (0)