nagios: move ping.cfg to a template so it works for both nagios servers

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2022-11-17 16:19:50 -08:00
parent 9e39477532
commit b9b35a09ed
3 changed files with 32 additions and 20 deletions

View file

@ -1,20 +0,0 @@
define service {
hostgroup_name all,!no_ping, !buildvm_armv7, !buildvm_s390x
service_description ICMP-Ping4
check_command check_ping4!350.0,20%!500.0,60%
use criticaltemplate
}
define service {
hostgroup_name buildvm_armv7, buildvm_s390x
service_description ICMP-Ping4-vm-builders
check_command check_ping4!1500.0,20%!2500.0,80%
use criticaltemplate
}
define service {
host_name nagios-external.fedoraproject.org
service_description ICMP-Ping6-check
check_command check-host-alive6!fedorapeople.org!1500.0,20%!2500.0,80%
use criticaltemplate
}

View file

@ -147,6 +147,16 @@
- nagios_server
notify: restart nagios
## Copy over the template command scripts
- name: Copy /etc/nagios/commands (templates)
templates: src=nagios/commands/{{ item }} dest=/etc/nagios/commands/{{ item }}
with_items:
- ping.cfg
tags:
- nagios_config
- nagios_server
notify: restart nagios
## Copy over the contacts
- name: Copy /etc/nagios/contacts
synchronize: src=nagios/contacts/ dest=/etc/nagios/contacts/

View file

@ -0,0 +1,22 @@
define service {
hostgroup_name all,!no_ping, !buildvm_armv7, !buildvm_s390x
service_description ICMP-Ping4
check_command check_ping4!350.0,20%!500.0,60%
use criticaltemplate
}
define service {
hostgroup_name buildvm_armv7, buildvm_s390x
service_description ICMP-Ping4-vm-builders
check_command check_ping4!1500.0,20%!2500.0,80%
use criticaltemplate
}
{% if vars['nagios_location'] == 'external' %}
define service {
host_name nagios-external.fedoraproject.org
service_description ICMP-Ping6-check
check_command check-host-alive6!fedorapeople.org!1500.0,20%!2500.0,80%
use criticaltemplate
}
{% endif %}