← Back to team overview

nagios-charmers team mailing list archive

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

 

Xav Paice has proposed merging ~xavpaice/nagios-charm:add-service_check_timeout_state into nagios-charm:master.

Requested reviews:
  Nagios Charm developers (nagios-charmers)

For more details, see:
https://code.launchpad.net/~xavpaice/nagios-charm/+git/nagios-charm/+merge/369495
-- 
Your team Nagios Charm developers is requested to review the proposed merge of ~xavpaice/nagios-charm:add-service_check_timeout_state into nagios-charm:master.
diff --git a/config.yaml b/config.yaml
index 5aff8c9..61cf689 100644
--- a/config.yaml
+++ b/config.yaml
@@ -184,3 +184,18 @@ options:
             A number of seconds before nrpe checks timeout from not being able
             to connect to the client or finish execution of the command.
             Raise this value to combat 'CHECK_NRPE Socket timeout alerts'
+    service_check_timeout_state:
+        default: c
+        type: string
+        description: |
+            This setting determines the state Nagios will report when a
+            service check times out - that is does not respond within
+            service_check_timeout seconds.  This can be useful if a
+            machine is running at too high a load and you do not want
+            to consider a failed service check to be critical (the default).
+            Valid settings are:
+            c - Critical (default)
+            u - Unknown
+            w - Warning
+            o - OK
+
diff --git a/hooks/templates/nagios-cfg.tmpl b/hooks/templates/nagios-cfg.tmpl
index b91ad94..16284a1 100644
--- a/hooks/templates/nagios-cfg.tmpl
+++ b/hooks/templates/nagios-cfg.tmpl
@@ -1050,7 +1050,7 @@ service_freshness_check_interval=60
 # w - Warning
 # o - OK
 
-service_check_timeout_state=c
+service_check_timeout_state={{ service_check_timeout_state }}
 
 
 
diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
index bb2e494..2871023 100755
--- a/hooks/upgrade-charm
+++ b/hooks/upgrade-charm
@@ -263,6 +263,7 @@ def update_config():
                        'nagios_hostname': "{}-{}".format(host_context, local_host_name),
                        'load_monitor': hookenv.config('load_monitor'),
                        'is_container': host.is_container(),
+                       'service_check_timeout_state': hookenv.config('service_check_timeout_state'),
                        }
 
     with open('hooks/templates/nagios-cfg.tmpl', 'r') as f:

Follow ups