be3c036794
- Why I did it Initially, we used Monit to monitor critical processes in each container. If one of critical processes was not running or crashed due to some reasons, then Monit will write an alerting message into syslog periodically. If we add a new process in a container, the corresponding Monti configuration file will also need to update. It is a little hard for maintenance. Currently we employed event listener of Supervisod to do this monitoring. Since processes in each container are managed by Supervisord, we can only focus on the logic of monitoring. - How I did it We borrowed the event listener of Supervisord to monitor critical processes in containers. The event listener will take following steps if it was notified one of critical processes exited unexpectedly: The event listener will first check whether the auto-restart mechanism was enabled for this container or not. If auto-restart mechanism was enabled, event listener will kill the Supervisord process, which should cause the container to exit and subsequently get restarted. If auto-restart mechanism was not enabled for this contianer, the event listener will enter a loop which will first sleep 1 minute and then check whether the process is running. If yes, the event listener exits. If no, an alerting message will be written into syslog. - How to verify it First, we need checked whether the auto-restart mechanism of a container was enabled or not by running the command show feature status. If enabled, one critical process should be selected and killed manually, then we need check whether the container will be restarted or not. Second, we can disable the auto-restart mechanism if it was enabled at step 1 by running the commnad sudo config feature autorestart <container_name> disabled. Then one critical process should be selected and killed. After that, we will see the alerting message which will appear in the syslog every 1 minute. - Which release branch to backport (provide reason below if selected) 201811 201911 [x ] 202006 |
||
---|---|---|
.. | ||
docker-saiserver-brcm | ||
docker-syncd-brcm | ||
docker-syncd-brcm-rpc | ||
saibcm-modules | ||
sonic-platform-modules-accton | ||
sonic-platform-modules-alphanetworks | ||
sonic-platform-modules-arista@937ea8abc1 | ||
sonic-platform-modules-brcm-xlr-gts | ||
sonic-platform-modules-cel | ||
sonic-platform-modules-dell | ||
sonic-platform-modules-delta | ||
sonic-platform-modules-ingrasys | ||
sonic-platform-modules-inventec | ||
sonic-platform-modules-juniper | ||
sonic-platform-modules-mitac | ||
sonic-platform-modules-quanta | ||
docker-ptf-brcm.dep | ||
docker-ptf-brcm.mk | ||
docker-saiserver-brcm.dep | ||
docker-saiserver-brcm.mk | ||
docker-syncd-brcm-rpc.dep | ||
docker-syncd-brcm-rpc.mk | ||
docker-syncd-brcm.dep | ||
docker-syncd-brcm.mk | ||
libsaithrift-dev.dep | ||
libsaithrift-dev.mk | ||
one-aboot.dep | ||
one-aboot.mk | ||
one-image.dep | ||
one-image.mk | ||
one-pde-image.dep | ||
platform-modules-accton.dep | ||
platform-modules-accton.mk | ||
platform-modules-alphanetworks.dep | ||
platform-modules-alphanetworks.mk | ||
platform-modules-arista.dep | ||
platform-modules-arista.mk | ||
platform-modules-brcm-xlr-gts.dep | ||
platform-modules-brcm-xlr-gts.mk | ||
platform-modules-cel.dep | ||
platform-modules-cel.mk | ||
platform-modules-dell.dep | ||
platform-modules-dell.mk | ||
platform-modules-delta.dep | ||
platform-modules-delta.mk | ||
platform-modules-ingrasys.dep | ||
platform-modules-ingrasys.mk | ||
platform-modules-inventec.dep | ||
platform-modules-inventec.mk | ||
platform-modules-juniper.dep | ||
platform-modules-juniper.mk | ||
platform-modules-mitac.dep | ||
platform-modules-mitac.mk | ||
platform-modules-quanta.dep | ||
platform-modules-quanta.mk | ||
platform-modules-s6000.dep | ||
platform.conf | ||
raw-image.dep | ||
raw-image.mk | ||
rules.dep | ||
rules.mk | ||
sai-modules.dep | ||
sai-modules.mk | ||
sai.dep | ||
sai.mk |