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

[multi-asic] Enhancing monit process checker for multi-asic. #6100

Merged
merged 6 commits into from
Dec 4, 2020

Conversation

abdosi
Copy link
Contributor

@abdosi abdosi commented Dec 2, 2020

Why I did:
Enhanced the monit process checked to support multi-asic .

How I did:

  • For given feature we get the host and network namespace instances it's processes should be running
    based on it's scope (global/asic) and add it to expected set.

  • From psutil we get number of running instances of the processes and add where it is running (host/network namespace) using "ip netns identify" to the the actual set

  • Difference between expected and actual set provides instances where the processes are not running
    and will be logged as syslog message by monit

How I verify:

  • O/P from Multi-asic platform
# Stop lldpmgrd in host lldp docker
admin@str2-xxxxx-acs-3:/var/log$ /usr/bin/process_checker lldp python /usr/bin/lldpmgrd
'python /usr/bin/lldpmgrd' is not running in host

# Stop ldpmgrd in lldp0 (asic0 namespace) docker
admin@str2-xxxx-acs-3:/var/log$ /usr/bin/process_checker lldp python /usr/bin/lldpmgrd
'python /usr/bin/lldpmgrd' is not running in host and in namespace asic0

# Stop ldpmgrd in lldp1 (asic1 namespace) docker
admin@str2-xxxxx-acs-3:/var/log$ /usr/bin/process_checker lldp python /usr/bin/lldpmgrd
'python /usr/bin/lldpmgrd' is not running in host and in namespace asic1, asic0
  • Verified on Single Asic platforms also.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Dec 2, 2020

This pull request introduces 1 alert when merging 872cd9f into 6846438 - view on LGTM.com

new alerts:

  • 1 for Unused import

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@abdosi
Copy link
Contributor Author

abdosi commented Dec 3, 2020

@jleveque and @yozhao101 can you please review/approve it.

@yozhao101
Copy link
Contributor

@jleveque and @yozhao101 can you please review/approve it.

Will leave a comment later.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@yozhao101
Copy link
Contributor

The changes look good to me. @jleveque Can you review it again please?

@abdosi abdosi merged commit 59c1e3a into sonic-net:master Dec 4, 2020
@abdosi abdosi deleted the multi_asic_monit branch December 4, 2020 18:39
abdosi added a commit that referenced this pull request Dec 4, 2020
Added Support of process checker for work on multi-asic platforms.
abdosi pushed a commit to abdosi/sonic-mgmt that referenced this pull request Dec 5, 2020
Signed-off-by: Abhishek Dosi <abdosi@micrsoft.com>
abdosi added a commit to sonic-net/sonic-mgmt that referenced this pull request Dec 5, 2020
After the merge of PR#sonic-net/sonic-buildimage#6100
the monit error syslog message will be changed with suffix having more information.

Updating the testcases monit syslog matching regex to match the new change
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…et#6100)

Added Support of process checker for work on multi-asic platforms.
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.

3 participants