diff --git a/defaults/main.yml b/defaults/main.yml index 5581355..4c5c706 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -55,4 +55,13 @@ nrpe_redis_hitrate_critical: 50 nrpe_redis_fragments_warning: '1.5' nrpe_redis_fragments_critical: '2.0' nrpe_redis_replication_lag_warning: 10 -nrpe_redis_replication_lag_critical: 60 \ No newline at end of file +nrpe_redis_replication_lag_critical: 60 + +nrpe_nvme_device: '/dev/nvme0n1' +nrpe_nvme_temperature_warning: 70 +nrpe_nvme_temperature_critical: 80 + +nrpe_zpool_name: 'myzpool' + +nrpe_uptime_warning: 30 +nrpe_uptime_critical: 1440 \ No newline at end of file diff --git a/templates/nrpe.j2 b/templates/nrpe.j2 index e957c39..5b5a3c5 100644 --- a/templates/nrpe.j2 +++ b/templates/nrpe.j2 @@ -122,4 +122,28 @@ command[check_redis_health_frag]=/usr/bin/sudo /usr/lib/nagios/plugins/check_red {% if nrpe_redis_replication_lag_warning is defined or nrpe_redis_replication_lag_critical is defined %} command[check_redis_health_replication]=/usr/bin/sudo /usr/lib/nagios/plugins/check_redis_health -x replication -w {{ nrpe_redis_replication_lag_warning }} -c {{ nrpe_redis_replication_lag_critical }} {% endif %} +{% endif %} + +{% if nrpe_pve_quorum is defined %} +# proxmox +command[check_pve_quorum]=/usr/bin/sudo /usr/lib/nagios/plugins/check_pve_quorum +{% if nrpe_pvesr is defined %} +command[check_pvesr]=/usr/bin/sudo /usr/lib/nagios/plugins/check_pvesr +{% endif %} +{% endif %} + +{% if nrpe_nvme_device is defined %} +# nvme smart +command[check_nvme_smart]=/usr/bin/sudo /usr/lib/nagios/plugins/check_nvme_smart -d {{ nrpe_nvme_device }} -w {{ nrpe_nvme_smart_warning }} -c {{ nrpe_nvme_smart_critical }} +command[check_nvme_temperature]=/usr/bin/sudo /usr/lib/nagios/plugins/check_nvme_temperature -d {{ nrpe_nvme_device }} -w {{ nrpe_nvme_temperature_warning }} -c {{ nrpe_nvme_temperature_critical }} +{% endif %} + +{% if nrpe_zpool_name is defined %} +# zpool +command[check_zpool]=/usr/bin/sudo /usr/lib/nagios/plugins/check_zpool_health {{ nrpe_zpool_name }} +{% endif %} + +{% if nrpe_uptime is defined %} +# uptime +command[check_uptime]=/usr/lib/nagios/plugins/check_uptime -w {{ nrpe_uptime_warning }} -c {{ nrpe_uptime_critical }} {% endif %} \ No newline at end of file diff --git a/templates/nrpe.sudoers.j2 b/templates/nrpe.sudoers.j2 index 62d0cb2..c4eac59 100644 --- a/templates/nrpe.sudoers.j2 +++ b/templates/nrpe.sudoers.j2 @@ -2,6 +2,8 @@ nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_postfix_mailqueue -w {{ nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_exim_mailqueue -w {{ nrpe_mailq_warning }} -c {{ nrpe_mailq_critical }} nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_raid nagios ALL=(ALL) NOPASSWD: /usr/sbin/needrestart -b -l + +{% if nrpe_kubernetes_controlplane is defined %} nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_cilium_health nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_coredns_health nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_etcd_health @@ -12,4 +14,25 @@ nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_k8s_pki_certs nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_k8s_pv_pvc nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_k8s_replicasets nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_k8s_pod_restarts -nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_redis_health \ No newline at end of file +{% endif %} + +{% if nrpe_redis_memory_warning is defined or nrpe_redis_memory_critical is defined or nrpe_redis_persistence is defined %} +nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_redis_health +{% endif %} + +{% if nrpe_zpool_name is defined %} +nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_zpool_health {{ nrpe_zpool_name }} +{% endif %} + +{% if nrpe_pve_quorum is defined %} +nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_pve_quorum +{% endif %} + +{% if nrpe_pvesr is defined %} +nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_pvesr +{% endif %} + +{% if nrpe_nvme_device is defined %} +nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_nvme_smart -d {{ nrpe_nvme_device }} -w {{ nrpe_nvme_smart_warning }} -c {{ nrpe_nvme_smart_critical }} +nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_nvme_temperature -d {{ nrpe_nvme_device }} -w {{ nrpe_nvme_temperature_warning }} -c {{ nrpe_nvme_temperature_critical }} +{% endif %} \ No newline at end of file