diff --git a/inventory/group_vars/all b/inventory/group_vars/all index b057ca10a5..eca3a57183 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -296,6 +296,7 @@ nagios_Check_Services: httpd: false swap: true ping: true + raid: false # Set variable if we want to use our global iptables defaults # Some things need to set their own. diff --git a/inventory/group_vars/virthost b/inventory/group_vars/virthost index b3008767e0..786636e255 100644 --- a/inventory/group_vars/virthost +++ b/inventory/group_vars/virthost @@ -18,3 +18,6 @@ csi_purpose: Host guest virtual machines. csi_relationship: | - Guests on this host will be inaccessible if the host is down. - This host will be required by any application with a virtual machine running on it, therefore, if this host is down those applications will be impacted. + +nagios_Check_Services: + raid: true diff --git a/roles/nagios_server/files/nagios/services/raid.cfg b/roles/nagios_server/files/nagios/services/raid.cfg index ec6f1cbea2..2c2bec03fd 100644 --- a/roles/nagios_server/files/nagios/services/raid.cfg +++ b/roles/nagios_server/files/nagios/services/raid.cfg @@ -1,22 +1,15 @@ -define service { - hostgroup_name virtservers - service_description Check_Raid - check_command check_by_nrpe!check_raid - use lighttemplate -} - -#define service { -# hostgroup_name buildservers -# service_description Check Raid -# check_command check_by_nrpe!check_raid -# use lighttemplate -# retry_interval 5 -# max_check_attempts 12 -#} - +# Special-case this so it can use retracetemplate. define service { hostgroup_name retrace service_description Check_Raid check_command check_by_nrpe!check_raid use retracetemplate } + +# Everything else uses this group. +define service { + hostgroup_name CheckRaid + service_description Check_Raid + check_command check_by_nrpe!check_raid + use lighttemplate +} diff --git a/roles/nagios_server/tasks/main.yml b/roles/nagios_server/tasks/main.yml index d164802acb..180b3140cc 100644 --- a/roles/nagios_server/tasks/main.yml +++ b/roles/nagios_server/tasks/main.yml @@ -412,6 +412,7 @@ - vpnclients.cfg - nomail.cfg - checkswap.cfg + - checkraid.cfg when: nagios_location == "internal" tags: - nagios_server diff --git a/roles/nagios_server/templates/nagios/hostgroups/checkraid.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/checkraid.cfg.j2 new file mode 100644 index 0000000000..0eba1887d2 --- /dev/null +++ b/roles/nagios_server/templates/nagios/hostgroups/checkraid.cfg.j2 @@ -0,0 +1,6 @@ +define hostgroup { + hostgroup_name CheckRaid + alias Raid-Issue + members {% for host in groups['all']|sort %}{% if hostvars[host].nagios_Check_Services['raid'] %}{{host}}{% if not loop.last %},{% endif %} {% endif %} {% endfor %} + +}