← Back to team overview

nagios-charmers team mailing list archive

[Merge] ~giulio.cervera/nagios-charm:bug/1860669 into nagios-charm:master

 

Giulio Cervera has proposed merging ~giulio.cervera/nagios-charm:bug/1860669 into nagios-charm:master.

Requested reviews:
  Nagios Charm developers (nagios-charmers)

For more details, see:
https://code.launchpad.net/~giulio.cervera/nagios-charm/+git/nagios-charm/+merge/378449
-- 
Your team Nagios Charm developers is requested to review the proposed merge of ~giulio.cervera/nagios-charm:bug/1860669 into nagios-charm:master.
diff --git a/config.yaml b/config.yaml
index 4fb975c..97fa5fa 100644
--- a/config.yaml
+++ b/config.yaml
@@ -217,4 +217,11 @@ options:
             u - Unknown
             w - Warning
             o - OK
-
+    broker_module:
+        type: string
+        default: ''
+        description: |
+            Directive used to specify an event broker module that should
+            by loaded by Nagios at startup
+            Example:
+            /opt/custommodule/module.so cfg_file=//opt/custommodule/module.cfg
diff --git a/hooks/templates/nagios-cfg.tmpl b/hooks/templates/nagios-cfg.tmpl
index 2d202b2..fe6fea0 100644
--- a/hooks/templates/nagios-cfg.tmpl
+++ b/hooks/templates/nagios-cfg.tmpl
@@ -255,6 +255,9 @@ event_broker_options=-1
 {% if enable_livestatus -%}
 broker_module=/usr/lib/check_mk/livestatus.o {{ livestatus_path }} {{ livestatus_args }}
 {% endif %}
+{% if broker_module -%}
+broker_module={{ broker_module }}
+{% endif %}
 
 
 # LOG ROTATION METHOD
diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
index 1016391..c1b7841 100755
--- a/hooks/upgrade-charm
+++ b/hooks/upgrade-charm
@@ -38,6 +38,7 @@ pagerduty_cfg = "/etc/nagios3/conf.d/pagerduty_nagios.cfg"
 pagerduty_cron = "/etc/cron.d/nagios-pagerduty-flush"
 password = hookenv.config('password')
 ro_password = hookenv.config('ro-password')
+broker_module = hookenv.config('broker_module')
 
 
 # Checks the charm relations for legacy relations
@@ -276,6 +277,7 @@ def update_config():
                        'is_container': host.is_container(),
                        'service_check_timeout': hookenv.config('service_check_timeout'),
                        'service_check_timeout_state': hookenv.config('service_check_timeout_state'),
+                       'broker_module': hookenv.config('broker_module'),
                        }
 
     with open('hooks/templates/nagios-cfg.tmpl', 'r') as f:

Follow ups