Merge ~xavpaice/charm-nagios:add-service_check_timeout_state into ~nagios-charmers/charm-nagios:master

Proposed by Xav Paice
Status: Merged
Approved by: James Hebden
Approved revision: f3ca873bee68047c744fa6e1e700137db19104bc
Merged at revision: d5170fd7a3c11c8655432747a9618943d72eae3e
Proposed branch: ~xavpaice/charm-nagios:add-service_check_timeout_state
Merge into: ~nagios-charmers/charm-nagios:master
Diff against target: 48 lines (+17/-1)
3 files modified
config.yaml (+15/-0)
hooks/templates/nagios-cfg.tmpl (+1/-1)
hooks/upgrade-charm (+1/-0)
Reviewer Review Type Date Requested Status
James Hebden (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+369495@code.launchpad.net

Commit message

add add-service_check_timeout_state config option

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
James Hebden (ec0) wrote :

LGTM, +1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision d5170fd7a3c11c8655432747a9618943d72eae3e

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index 5aff8c9..61cf689 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -184,3 +184,18 @@ options:
6 A number of seconds before nrpe checks timeout from not being able
7 to connect to the client or finish execution of the command.
8 Raise this value to combat 'CHECK_NRPE Socket timeout alerts'
9+ service_check_timeout_state:
10+ default: c
11+ type: string
12+ description: |
13+ This setting determines the state Nagios will report when a
14+ service check times out - that is does not respond within
15+ service_check_timeout seconds. This can be useful if a
16+ machine is running at too high a load and you do not want
17+ to consider a failed service check to be critical (the default).
18+ Valid settings are:
19+ c - Critical (default)
20+ u - Unknown
21+ w - Warning
22+ o - OK
23+
24diff --git a/hooks/templates/nagios-cfg.tmpl b/hooks/templates/nagios-cfg.tmpl
25index b91ad94..16284a1 100644
26--- a/hooks/templates/nagios-cfg.tmpl
27+++ b/hooks/templates/nagios-cfg.tmpl
28@@ -1050,7 +1050,7 @@ service_freshness_check_interval=60
29 # w - Warning
30 # o - OK
31
32-service_check_timeout_state=c
33+service_check_timeout_state={{ service_check_timeout_state }}
34
35
36
37diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
38index bb2e494..2871023 100755
39--- a/hooks/upgrade-charm
40+++ b/hooks/upgrade-charm
41@@ -263,6 +263,7 @@ def update_config():
42 'nagios_hostname': "{}-{}".format(host_context, local_host_name),
43 'load_monitor': hookenv.config('load_monitor'),
44 'is_container': host.is_container(),
45+ 'service_check_timeout_state': hookenv.config('service_check_timeout_state'),
46 }
47
48 with open('hooks/templates/nagios-cfg.tmpl', 'r') as f:

Subscribers

People subscribed via source and target branches