-
Notifications
You must be signed in to change notification settings - Fork 9
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
New Feature: Failed Mode #7
base: master
Are you sure you want to change the base?
Conversation
… only CRITICAL if any service has state "failed" This mode can be combined with '-i' to set services which should be ignored. Example: check-systemd.rb -f -i kdump.service
Thanks for your contribution to Sensu plugins! Without people like you submitting PRs we couldn't run the project. I will review it shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty sane, can you please include a manual or automated testing artifact?
I appeased the cops for you.
Thanks for fixing the cops. While writing this gist i also noticed that the 3rd test fails. I will have a look at that. |
I can't get the 'next if' clause. it seems like the condition after the OR is not evaluated.
Maybe you could help? |
This is perfect.
If I look at the next test it shows they are not present, which matches what I have locally, if the service does indeed exist can you include the output of service
I will take a look. |
I am confused why is there a patch file in the PR and did you still need my help figuring the code? In the actual check I dont see that line of code which it looks like you deleted here |
Added 'failed' Mode. This Mode checks all systemd service and reports only CRITICAL if any service has state "failed". I added the cause i wanted to monitor all my services on my linux (EL7) Hosts.
The name "failed mode" may not be the best - but I couldn't think of anything better. Maybe someone's got a better idea.
This is my first modification of a Ruby Script - hope my code is not too ugly....
Pull Request Checklist
Is this in reference to an existing issue?
No
General
Update Changelog following the conventions laid out here
Update README with any necessary configuration snippets
- [] Binstubs are created if needed- [] Existing tests passPurpose
Known Compatibility Issues