Merge lp:~paulgear/charm-helpers/nrpe-service-immediate-check into lp:charm-helpers
Proposed by
Paul Gear
Status: | Merged |
---|---|
Merged at revision: | 700 |
Proposed branch: | lp:~paulgear/charm-helpers/nrpe-service-immediate-check |
Merge into: | lp:charm-helpers |
Diff against target: |
71 lines (+21/-10) 2 files modified
charmhelpers/contrib/charmsupport/nrpe.py (+19/-10) tests/contrib/charmsupport/test_nrpe.py (+2/-0) |
To merge this branch: | bzr merge lp:~paulgear/charm-helpers/nrpe-service-immediate-check |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Approve | ||
charmers | Pending | ||
Review via email: mp+300682@code.launchpad.net |
Description of the change
Add an option for immediate execution of nrpe service checks. This is necessary because (for sysvinit-based services) the cron file installed only runs the check every 5 minutes.
If a nagios service check is created but the check does not fire before the end of a CI run which does nagios checks at the end, the nagios check will return an error and the CI run will fail.
This change works around that by allowing a charm to specify that a check should be run immediately, to ensure the check file is created.
To post a comment you must log in.
Minor inline comments.
I think the default should be immediate_ check=True. Charms need to explicitly call add_init_ service_ checks( ), and any charm doing that for a bogus service that hangs on the status check is already broken. It is better to discover that now rather than later when there are a zillion hung /usr/local/ lib/nagios/ plugins/ check_exit_ status. pl processes. Or just add timeout(1) to the command line.