sonic-buildimage/platform/nephos
yozhao101 be3c036794
[supervisord] Monitoring the critical processes with supervisord. (#6242)
- 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
2021-01-21 12:57:49 -08:00
..
docker-syncd-nephos [supervisord] Monitoring the critical processes with supervisord. (#6242) 2021-01-21 12:57:49 -08:00
docker-syncd-nephos-rpc [supervisord]: use abspath as supervisord entrypoint (#5995) 2020-11-22 21:18:44 -08:00
nephos-modules [kernel]: upgrade linux kernel to 4.9.118 (#4897) 2020-07-12 18:08:51 +00:00
sonic-platform-modules-accton [kernel]: upgrade linux kernel to 4.9.118 (#4897) 2020-07-12 18:08:51 +00:00
sonic-platform-modules-cig Fix a number of LGTM alerts (#5952) 2020-11-20 10:58:48 -08:00
sonic-platform-modules-ingrasys [MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector (#4035) 2020-01-22 11:26:23 -08:00
sonic-platform-modules-pegatron [kernel]: upgrade linux kernel to 4.9.118 (#4897) 2020-07-12 18:08:51 +00:00
docker-ptf-nephos.mk [build]: add docker-ptf-* as stretch docker targets (#4516) 2020-05-01 11:20:33 -07:00
docker-syncd-nephos-rpc.mk [syncd-rpc.mk] install ptf dependancy (#4279) 2020-03-18 11:59:39 -07:00
docker-syncd-nephos.mk [docker-syncd-vs]: Convert syncd-vs docker to buster (#4726) 2020-06-09 09:07:25 -07:00
libsaithrift-dev.mk [nephos]: upgrade compile sdk.deb from online to dpkg and fix compile error (#2800) 2019-04-29 18:25:40 -07:00
nephos-modules.mk [platform/nephos] Optimize the code to reduce changes due to the kernel upgrade (#4332) 2020-05-21 02:21:07 -07:00
one-image.mk [Device]: Add new CIG device CS6436-54P and CS5435-54P, also update code for CS6436-56P (#4157) 2020-02-17 14:09:15 -08:00
platform-modules-accton.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-cig.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-ingrasys.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-pegatron.mk [Nephos]: Add Porsch project with Nephos (#2224) 2018-11-09 14:01:43 -08:00
platform.conf [Platform] Add Ingrasys S9130-32X and S9230-64X with Nephos Switch ASIC (#1245) 2017-12-22 10:04:29 -08:00
rules.mk [build]: wait for conflicts package to be uninstalled (#5039) 2020-07-27 10:46:20 -07:00
sai.mk [build]: wait for conflicts package to be uninstalled (#5039) 2020-07-27 10:46:20 -07:00