diff --git a/defaults/main.yml b/defaults/main.yml index 7b86bcb..430ebd5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -44,4 +44,4 @@ nrpe_mysql_longqueries_warning: 600 nrpe_mysql_longqueries_critical: 1200 nrpe_proc_age_warning: 400 -nrpe_proc_age_critical: 600 \ No newline at end of file +nrpe_proc_age_critical: 600 diff --git a/templates/nrpe.j2 b/templates/nrpe.j2 index 182cdaa..381c7bb 100644 --- a/templates/nrpe.j2 +++ b/templates/nrpe.j2 @@ -14,7 +14,9 @@ command[check_ssl]=/usr/lib/nagios/plugins/check_http --sni '{{ nrpe_ssl_host }} command[check_bandwidth]=/usr/lib/nagios/plugins/check_eth -i {{ ansible_default_ipv4.interface }} -w {{ nrpe_bandwidth_warning }} -c {{ nrpe_bandwidth_critical }} command[check_systemd_fail2ban]=/usr/lib/nagios/plugins/check_systemd_service fail2ban {% if nrpe_proc_age_process is defined or nrpe_proc_age_warning is defined or nrpe_proc_age_critical is defined %} -command[check_proc_age]=/usr/lib/nagios/plugins/check_proc_age -p {{ nrpe_proc_age_process }} -w {{ nrpe_proc_age_warning }} -c {{ nrpe_proc_age_critical }} +{% for process in nrpe_proc_age_process | default([]) %} +command[check_proc_age_{{ process }}]=/usr/lib/nagios/plugins/check_proc_age -p {{ process }} -w {{ nrpe_proc_age_warning }} -c {{ nrpe_proc_age_critical }} +{% endfor %} {% endif %} command[check_systemd_failed]=/usr/lib/nagios/plugins/check_systemd_failed command[check_needrestart]=/usr/lib/nagios/plugins/check_needrestart @@ -83,12 +85,10 @@ command[check_systemd_{{ service }}]=/usr/lib/nagios/plugins/check_systemd_servi {% if nrpe_kubernetes is defined or nrpe_kubernetes_manager is defined %} # kubernetes -{% if nrpe_kubernetes is defined %} ## nodes command[check_systemd_kubelet]=/usr/lib/nagios/plugins/check_systemd_service kubelet command[check_systemd_etcd]=/usr/lib/nagios/plugins/check_systemd_service etcd command[check_systemd_containerd]=/usr/lib/nagios/plugins/check_systemd_service containerd -{% endif %} {% if nrpe_kubernetes_manager is defined %} ## manager / control plane command[check_k8s_health]=/usr/lib/nagios/plugins/check_http -I {{ ansible_default_ipv4.address }} -p 6443 -S -u /healthz --continue-after-certificate -r ok -w 1 -c 2