nagios-charmers team mailing list archive
-
nagios-charmers team
-
Mailing list archive
-
Message #00305
[Merge] ~aluria/nagios-charm:bug/1748430 into nagios-charm:master
Alvaro Uría has proposed merging ~aluria/nagios-charm:bug/1748430 into nagios-charm:master.
Commit message:
Nagios checks the rootfs on containers
Requested reviews:
Nagios Charm developers (nagios-charmers)
For more details, see:
https://code.launchpad.net/~aluria/nagios-charm/+git/nagios-charm/+merge/363865
--
Your team Nagios Charm developers is requested to review the proposed merge of ~aluria/nagios-charm:bug/1748430 into nagios-charm:master.
diff --git a/hooks/templates/localhost_nagios2.cfg.tmpl b/hooks/templates/localhost_nagios2.cfg.tmpl
index 85c756f..3cd69e1 100644
--- a/hooks/templates/localhost_nagios2.cfg.tmpl
+++ b/hooks/templates/localhost_nagios2.cfg.tmpl
@@ -7,7 +7,7 @@
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
-#
+#
define host{
use generic-host ; Name of host template to use
@@ -28,7 +28,11 @@ define service{
use generic-service ; Name of service template to use
host_name {{ nagios_hostname }}
service_description Disk Space
+{%- if is_container %}
+ check_command check_disk!20%!10%!/
+{%- else %}
check_command check_all_disks!20%!10%
+{%- endif %}
}
@@ -58,7 +62,7 @@ define service{
-# Define a service to check the load on the local machine.
+# Define a service to check the load on the local machine.
define service{
use generic-service ; Name of service template to use
diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
index f9cd034..d52cee5 100755
--- a/hooks/upgrade-charm
+++ b/hooks/upgrade-charm
@@ -260,6 +260,7 @@ def update_config():
'monitor_self': hookenv.config('monitor_self'),
'nagios_hostname': "{}-{}".format(host_context, local_host_name),
'load_monitor': hookenv.config('load_monitor'),
+ 'is_container': host.is_container(),
}
with open('hooks/templates/nagios-cfg.tmpl', 'r') as f:
@@ -357,7 +358,7 @@ update_cgi_config()
update_password('nagiosro', ro_password)
if password:
update_password('nagiosadmin', password)
-
+
subprocess.call(['hooks/mymonitors-relation-joined'])
subprocess.call(['hooks/monitors-relation-changed'])
References