Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[201911][Monit] Unmonitor processes in disabled containers #5462

Merged
merged 13 commits into from
Sep 25, 2020
Merged

[201911][Monit] Unmonitor processes in disabled containers #5462

merged 13 commits into from
Sep 25, 2020

Conversation

yozhao101
Copy link
Contributor

- Why I did it
We want to let Monit to unmonitor the processes in containers which are disabled in FEATURE table such that
Monit will not generate false alerting messages into the syslog.

- How I did it
Monit will periodically run a script which accepts three parameters: <container_name>, <process_name> and
<process_cmdline>. This script will first check whether the container is disabled in the FEATURE table or not.
If it is disabled, Monit will skip monitoring the processes. Otherwise, this script will leverage psutil library to inspect
the process tree in host to look for the processes. If the process is not found, then an alerting message will be written
into syslog.

- How to verify it
We can change the state field of a container in FEATURE table from enabled to disabled and then kill a critical
process in it to see whether Monit can generate the alerting message in syslog or not. The message format in syslog is:
<process_name> is not running.

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit ad64dc6)
Signed-off-by: Yong Zhao <[email protected]>
Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit b1cb0ba)
Signed-off-by: Yong Zhao <[email protected]>
files.

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit 55237ee)
Signed-off-by: Yong Zhao <[email protected]>
host under /etc/monit/conf.d in docker-teamd.mk.

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit a671f45)
Signed-off-by: Yong Zhao <[email protected]>
Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit 9ecb61d)
Signed-off-by: Yong Zhao <[email protected]>
…to match the syncd process.

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit e4c0824)
Signed-off-by: Yong Zhao <[email protected]>
process_checker.

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit fe167c4)
Signed-off-by: Yong Zhao <[email protected]>
Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit b576e19)
Signed-off-by: Yong Zhao <[email protected]>
instead of process name in syslog.

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit b0c86e8)
Signed-off-by: Yong Zhao <[email protected]>
Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit 1a4e481)
Signed-off-by: Yong Zhao <[email protected]>
process_checker.

Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit 875a2a5)
Signed-off-by: Yong Zhao <[email protected]>
Signed-off-by: Yong Zhao <[email protected]>
(cherry picked from commit 4fd77cc)
Signed-off-by: Yong Zhao <[email protected]>
@jleveque jleveque merged commit 7580c84 into sonic-net:201911 Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants