diff --git a/defaults/main.yml b/defaults/main.yml index 3ab0f00..bca548d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,3 @@ --- nagios_extra_groups: [] +nrpe_check_disk_exclude: [] diff --git a/templates/nrpe.cfg.j2 b/templates/nrpe.cfg.j2 index 79cd57d..56fa0e2 100644 --- a/templates/nrpe.cfg.j2 +++ b/templates/nrpe.cfg.j2 @@ -292,7 +292,7 @@ ssl_cacert_file=/etc/ssl/certs/ca-certificates.crt command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10 command[check_load]=/usr/lib/nagios/plugins/check_load -r -w 7,3.5,3 -c 8,4,3.5 -command[check_disks]=/usr/lib/nagios/plugins/check_disk -w 16% -c 9% -A -i /var/lib/docker/overlay2 -i /var/lib/docker/containers -i /run/docker/{% if inventory_hostname == 'geb.ra.nemunai.re' %} -i /media/musik{% endif %} +command[check_disks]=/usr/lib/nagios/plugins/check_disk -w 16% -c 9% -A{% for nrpe_exclude in nrpe_check_disk_exclude %} -i {{ nrpe_exclude }}{% endfor %} command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1 command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z @@ -306,22 +306,10 @@ command[check_ntp_time]=/usr/lib/nagios/plugins/check_ntp_time -H fr.pool.ntp.or {% else %} command[check_ntp_time]=/usr/lib/nagios/plugins/check_ntp_time -H {{ ntp_pool[0] }} -w 1 -c 2 {% endif %} -{% if inventory_hostname == 'geb.ra.nemunai.re' %} -command[check_log_age_ankh.serekh.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/ankh.serekh.nemunai.re/messages.log -command[check_log_age_geb.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/geb.ra.nemunai.re/messages.log -command[check_log_age_hathor.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/hathor.ra.nemunai.re/messages.log -command[check_log_age_montou.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/montou.ra.nemunai.re/messages.log -command[check_log_age_nout.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/nout.ra.nemunai.re/messages.log -command[check_log_age_sekhmet0.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet0.ra.nemunai.re/messages.log -command[check_log_age_sekhmet1.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet1.ra.nemunai.re/messages.log -command[check_log_age_sekhmet2.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet2.ra.nemunai.re/messages.log -command[check_log_age_sekhmet3.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet3.ra.nemunai.re/messages.log -command[check_log_age_sekhmet4.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet4.ra.nemunai.re/messages.log -command[check_log_age_sekhmet5.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet5.ra.nemunai.re/messages.log -command[check_log_age_sekhmet6.ra.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/sekhmet6.ra.nemunai.re/messages.log -command[check_log_age_ouaset.masr.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/ouaset.masr.nemunai.re/messages.log -command[check_log_age_rhakotis.masr.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/rhakotis.masr.nemunai.re/messages.log -command[check_log_age_jizah.masr.nemunai.re]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/jizah.masr.nemunai.re/messages.log +{% if inventory_hostname in groups['logger-hosts'] %} +{% for host in groups['all'] %} +command[check_log_age_{{ host }}]=/usr/lib/nagios/plugins/check_file_age -w 1800 -c 3600 -W 32 -C 32 /var/log/{{ host }}/messages.log +{% endfor %} {% endif %} # The following examples allow user-supplied arguments and can # only be used if the NRPE daemon was compiled with support for