Files
nrpe/templates/nrpe.j2
2025-09-30 14:52:20 +02:00

89 lines
4.7 KiB
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Ansible managed - DO NOT EDIT MANUALLY !
allowed_hosts={{ nrpe_allowed_hosts }}
dont_blame_nrpe=1
# base
command[check_load]=/usr/lib/nagios/plugins/check_load -w {{ nrpe_load_warning }} -c {{ nrpe_load_critical }}
command[check_memory]=/usr/lib/nagios/plugins/check_memory -w {{ nrpe_memory_warning }} -c {{ nrpe_memory_critical }} -W {{ nrpe_swap_warning }} -C {{ nrpe_swap_critical }}
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 500 -c 800
command[check_process]=/usr/lib/nagios/plugins/check_process
command[check_dns]=/usr/lib/nagios/plugins/check_dns -H google.com
{% if nrpe_ssl_host is defined %}
command[check_ssl]=/usr/lib/nagios/plugins/check_http --sni '{{ nrpe_ssl_host }}' -C 14,3
{% endif %}
command[check_eth]=/usr/lib/nagios/plugins/check_eth -i {{ ansible_default_ipv4.interface }} -w 12M -c 15M
command[check_proc_fail2ban]=/usr/lib/nagios/plugins/check_procs -a fail2ban -w 1: -c 1:
command[check_proc_age]=/usr/lib/nagios/plugins/check_proc_age -p <proc> -w 400 -c 600
command[check_systemd_failed]=/usr/lib/nagios/plugins/check_systemd_failed
command[check_needrestart]=/usr/lib/nagios/plugins/check_needrestart
# check_disk_usage
# -w <%>: Warning threshold for block usage.
# -c <%>: Critical threshold for block usage.
# -W <%>: Warning threshold for inode usage.
# -C <%>: Critical threshold for inode usage.
# -e <mount>: Exclude a mount point by exact match (e.g., -e /tmp).
# -E <regex>: Exclude mount points matching a regex pattern (e.g., -E '/run/user/.*').
# -x <type>: Exclude a filesystem type (e.g., -x tmpfs).
command[check_disk_usage]=/usr/lib/nagios/plugins/check_disk_usage -w 80 -c 90 -e /run -e /dev -e /dev/shm -e /sys -e /proc -e /sys/kernel/debug/tracing -x tmpfs -x overlay -x fuse -x proc -x devtmpfs
command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 30% -W 30% -c 10% -K 10% -p /
command[check_rw_root]=/usr/lib/nagios/plugins/check_rofs /
{% if nrpe_disk is defined %}
{% for target in nrpe_disk %}
command[check_disk_data]=/usr/lib/nagios/plugins/check_disk -w 30% -W 30% -c 10% -K 10% -p /data
command[check_rw_data]=/usr/lib/nagios/plugins/check_rofs /data
{% endfor %}
{% endif %}
{% if nrpe_mysql is defined %}
# mysql
command[check_mysql]=/usr/lib/nagios/plugins/check_mysql -u {{ nrpe_mysql_user }} -p{{ nrpe_mysql_password }} -H {{ nrpe_mysql_host }} -d mysql
command[check_mysql_longqueries]=/usr/lib/nagios/plugins/check_mysql_longqueries -u {{ nrpe_mysql_user }} -p{{ nrpe_mysql_password }} -H {{ nrpe_mysql_host }} -w 600 -c 1200
{% endif %}
{% if nrpe_postgresql is defined %}
# postgresql
command[check_pgsql_port]=/usr/lib/nagios/plugins/check_tcp -p {{ nrpe_postgresql_port }}
command[check_proc_postgresql]=/usr/lib/nagios/plugins/check_systemd_service postgresql
command[check_pgsql_connection]=/usr/lib/nagios/plugins/check_postgresql -H {{ nrpe_postgresql_host }} -p {{ nrpe_postgresql_port }} --dbuser={{ nrpe_postgresql_user }} --dbpass={{ nrpe_postgresql_password }} --action=connection
command[check_pgsql_backends]=/usr/lib/nagios/plugins/check_postgresql -H {{ nrpe_postgresql_host }} -p {{ nrpe_postgresql_port }} --dbuser={{ nrpe_postgresql_user }} --dbpass={{ nrpe_postgresql_password }} --action=backends -w {{ nrpe_postgresql_backend_warning }} -c {{ nrpe_postgresql_backend_critical }}
{% endif %}
{% if nrpe_mail is defined %}
# mail
command[check_smtp]=/usr/lib/nagios/plugins/check_tcp -p 25 -H {{ nrpe_smtp_host }}
{% endif %}
{% if nrpe_mail_service is defined %}
{% if nrpe_mail_service == 'postfix' %}
command[check_mailq]=/usr/bin/sudo /usr/lib/nagios/plugins/check_postfix_mailqueue -w {{ nrpe_mailq_warning }} -c {{ nrpe_mailq_critical }}
{% elif nrpe_mail_service == 'exim' %}
command[check_mailq]=/usr/bin/sudo /usr/lib/nagios/plugins/check_exim_mailqueue -w {{ nrpe_mailq_warning }} -c {{ nrpe_mailq_critical }}
{% endif %}
{% endif %}
{% if nrpe_raid_soft is defined %}
command[check_mdadm]=/usr/lib/nagios/plugins/check_mdadm
{% endif %}
{% if nrpe_raid_3ware is defined %}
command[check_3ware]=/usr/bin/sudo /usr/lib/nagios/plugins/check_3ware
{% endif %}
{% if nrpe_raid is defined %}
command[check_3ware]=/usr/bin/sudo /usr/lib/nagios/plugins/check_raid
{% endif %}
{% if nrpe_docker_container is defined %}
{% for container in nrpe_docker_container %}
command[check_docker_{{ container }}]=/usr/lib/nagios/plugins/check_docker --containers {{ container }}.* --status running --restarts 2:5 --present
{% endfor %}
{% endif %}
{% if nrpe_process is defined %}
{% for process in nrpe_process %}
command[check_proc_{{ process }}]=/usr/lib/nagios/plugins/check_systemd_service {{ process }}
{% endfor %}
{% endif %}