sonic-buildimage/files/image_config/monit
Lior Avramov ff3ad9ddd1 [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-28 20:37:22 +00:00
..
conf.d [monit] Periodically monitor VNET route consistency (#8266) 2021-08-19 16:29:25 -07:00
container_checker [hostcfgd] record feature state in STATE DB (#9842) 2022-03-14 13:45:27 +02:00
memory_checker [memory_checker] Do not check memory usage of containers if docker daemon is not running (#11476) 2022-07-28 20:37:22 +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-28 11:13:44 -07:00