sonic-buildimage/files/image_config/monit
Lior Avramov a40aca43b9 [memory_checker] Do not check memory usage of containers if docker daemon is not running (#11476)
Fix in Monit memory_checker plugin. Skip fetching running containers if docker engine is down (can happen in deinit).
This PR fixes issue #11472.

Signed-off-by: liora liora@nvidia.com

Why I did it
In the case where Monit runs during deinit flow, memory_checker plugin is fetching the running containers without checking if Docker service is still running. I added this check.

How I did it
Use systemctl is-active to check if Docker engine is still running.

How to verify it
Use systemctl to stop docker engine and reload Monit, no errors in log and relevant print appears in log.

Which release branch to backport (provide reason below if selected)
The fix is required in 202205 and 202012 since the PR that introduced the issue was cherry picked to those branches (#11129).
2022-07-27 23:28:19 +00:00
..
conf.d [monit] Periodically monitor VNET route consistency (#8266) 2021-08-23 03:05:16 +00:00
container_checker Update container_checker for multi-asic devices when state is 'always_enabled' (#10067) 2022-03-14 23:01:43 +00:00
memory_checker [memory_checker] Do not check memory usage of containers if docker daemon is not running (#11476) 2022-07-27 23:28:19 +00:00
monitrc [Monit] Delay start of monitoring for 5 minutes (#4281) 2020-03-19 14:14:47 -07:00
restart_service [Monit] Restart telemetry container if memory usage is beyond the threshold (#7645) 2021-05-31 04:38:18 +00:00