sonic-buildimage/platform/barefoot
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
..
bfn-modules [kernel]: upgrade linux kernel to 4.9.118 (#4897) 2020-07-12 18:08:51 +00:00
docker-saiserver-bfn [supervisord]: use abspath as supervisord entrypoint (#5995) 2020-11-22 21:18:44 -08:00
docker-syncd-bfn [supervisord] Monitoring the critical processes with supervisord. (#6242) 2021-01-21 12:57:49 -08:00
docker-syncd-bfn-rpc [supervisord]: use abspath as supervisord entrypoint (#5995) 2020-11-22 21:18:44 -08:00
sonic-platform-modules-arista@937ea8abc1 [Arista] Update driver submodules (#6396) 2021-01-10 07:42:56 -08:00
sonic-platform-modules-bfn [barefoot] Platform API 2.0 fixups (#5539) 2020-10-05 10:50:03 -07:00
sonic-platform-modules-bfn-montara [BFN] Convert platform modules to python 3 (#6347) 2021-01-04 15:00:48 -08:00
sonic-platform-modules-bfn-newport BFN platform API 2.0 support (#4766) 2020-10-03 13:46:21 -07: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-wnc-osw1800 [kernel]: upgrade linux kernel to 4.9.118 (#4897) 2020-07-12 18:08:51 +00:00
bfn-modules.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
bfn-platform-ingrasys.mk [platform] update Ingrassy platform to support stretch (#2322) 2018-11-30 20:46:36 -08:00
bfn-platform-wnc.mk [barefoot]: Support for platforms based on Barefoot Networks' device (#1796) 2018-07-24 10:23:12 -07:00
bfn-platform.mk [BFN] Upgrade docker-syncd-bfn to buster (#6345) 2021-01-04 10:38:53 -08:00
bfn-sai.mk [BFN] Upgrade docker-syncd-bfn to buster (#6345) 2021-01-04 10:38:53 -08:00
docker-ptf-bfn.mk [BFN] Upgrade docker-syncd-bfn to buster (#6345) 2021-01-04 10:38:53 -08:00
docker-syncd-bfn-rpc.mk [BFN] Upgrade docker-syncd-bfn to buster (#6345) 2021-01-04 10:38:53 -08:00
docker-syncd-bfn.mk [BFN] Upgrade docker-syncd-bfn to buster (#6345) 2021-01-04 10:38:53 -08:00
libsaithrift-dev.mk [sai and sairedis] advance sairedis sub-module and upgrade to matching Broadcom SAI build (#2488) 2019-02-16 10:14:18 -08:00
one-aboot.mk [arista] update platform driver submodules (#4512) 2020-04-30 12:06:19 -07:00
one-image.mk [pmon]: Install vanilla 'thrift' Python 2 and 3 packages for Barefoot in host and PMon (#6080) 2020-12-04 08:41:17 -08:00
platform-modules-arista.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-bfn-montara.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-bfn-newport.mk [barefoot][platform] Update BFN platforms (#5356) 2020-09-16 10:34:49 -07:00
platform-modules-bfn.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-wnc-osw1800.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform.conf [barefoot]: Support for platforms based on Barefoot Networks' device (#1796) 2018-07-24 10:23:12 -07:00
rules.mk [build]: wait for conflicts package to be uninstalled (#5039) 2020-07-27 10:46:20 -07:00