sonic-buildimage/files/image_config/monit
yozhao101 d63d16ba58 [memory_checker] Do not check memory usage of containers which are not created (#11129)
Signed-off-by: Yong Zhao yozhao@microsoft.com

Why I did it
This PR aims to fix an issue (#10088) by enhancing the script memory_checker.

Specifically, if container is not created successfully during device is booted/rebooted, then memory_checker do not need check its memory usage.

How I did it
In the script memory_checker, a function is added to get names of running containers. If the specified container name is not in current running container list, then this script will exit without checking its memory usage.

How to verify it
I tested on a lab device by following the steps:

Stops telemetry container with command sudo systemctl stop telemetry.service

Removes telemetry container with command docker rm telemetry

Checks whether the script memory_checker ran by Monit will generate the syslog message saying it will exit without checking memory usage of telemetry.
2022-06-19 08:01:18 +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 which are not created (#11129) 2022-06-19 08:01:18 +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