[Monit] Monitoring the running status of containers.#6251
Merged
lguohan merged 18 commits intosonic-net:masterfrom Jan 8, 2021
yozhao101:monitoring_containers
Merged
[Monit] Monitoring the running status of containers.#6251lguohan merged 18 commits intosonic-net:masterfrom yozhao101:monitoring_containers
lguohan merged 18 commits intosonic-net:masterfrom
yozhao101:monitoring_containers
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- Why I did it
This PR aims to monitor the running status of each container. Currently the auto-restart feature was enabled. If a critical process exited unexpected, the container will be restarted. If the container was restarted 3 times during 20 minutes, then it will not run anymore unless we cleared the flag using the command
sudo systemctl reset-failed <container_name>manually.- How I did it
We will employ Monit to monitor a script. This script will generate the expected running container list and compare it with the current running containers. If there are containers which were expected to run but were not running, then an alerting message will be written into syslog.
- How to verify it
I tested this feature on a lab device
str-a7050-acs-3which has single ASIC andstr2-n3164-acs-3which has a Multi-ASIC. First I manually stopped a container by running the commandsudo systemctl stop <container_name>, then I checked whether there was an alerting message in the syslog.- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)