Skip to content
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

[chassis-packet][SNMP] Enable SNMP dynamic frequency on packet chassis #21355

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dockers/docker-snmp/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ RUN apt-get -y purge \
find / | grep -E "__pycache__" | xargs rm -rf && \
rm -rf /debs /python-wheels ~/.cache

COPY ["docker-snmp-init.sh", "/usr/bin/"]
COPY ["start.sh", "/usr/bin/"]
COPY ["snmp_yml_to_configdb.py", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["*.j2", "/usr/share/sonic/templates/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

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

ENTRYPOINT ["/usr/local/bin/supervisord"]
RUN chmod +x /usr/bin/docker-snmp-init.sh
ENTRYPOINT ["/usr/bin/docker-snmp-init.sh"]
5 changes: 5 additions & 0 deletions dockers/docker-snmp/docker-snmp-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#Generate supervisord.conf based on device metadata
mkdir -p /etc/supervisor/conf.d/
sonic-cfggen -d -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
exec /usr/local/bin/supervisord
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ dependent_startup=true
dependent_startup_wait_for=start:exited

[program:snmp-subagent]
{% if DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
command=/usr/bin/env python3 -m sonic_ax_impl --enable_dynamic_frequency
{% else %}
command=/usr/bin/env python3 -m sonic_ax_impl
{% endif %}
priority=4
autostart=false
autorestart=false
Expand Down
Loading