Add monit_snmp file to monitor memory usage (#14464) (#14730)

This commit is contained in:
mssonicbld 2023-04-20 05:21:17 +08:00 committed by GitHub
parent 2cad50372a
commit 96affcc0df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
###############################################################################
## Monit configuration for snmp container
###############################################################################
check program container_memory_snmp with path "/usr/bin/memory_checker snmp 4294967296"
if status == 3 for 10 times within 20 cycles then exec "/usr/bin/docker exec snmp supervisorctl restart snmp-subagent"

View File

@ -31,6 +31,7 @@ $(DOCKER_SNMP)_RUN_OPT += --privileged -t
$(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_SNMP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro
$(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d
SONIC_BULLSEYE_DOCKERS += $(DOCKER_SNMP)
SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_SNMP_DBG)