nrpe/templates/nrpe.j2

81 lines
4.5 KiB
Plaintext
Raw Permalink Normal View History

2024-12-17 17:26:32 +01:00
# Ansible managed - DO NOT EDIT MANUALLY !
2024-12-16 19:24:54 +01:00
allowed_hosts={{ nrpe_allowed_hosts }}
dont_blame_nrpe=1
2024-12-17 17:26:32 +01:00
# base
2024-12-16 19:24:54 +01:00
command[check_load]=/usr/lib/nagios/plugins/check_load -w {{ nrpe_load_warning }} -c {{ nrpe_load_critical }}
2024-12-17 17:26:32 +01:00
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 }}
2024-12-16 19:24:54 +01:00
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
2024-12-17 17:26:32 +01:00
{% 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
2024-12-16 19:24:54 +01:00
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
# disk
# -w space warning / -c space critical / -W inode warning / -K inode criticak / -C reset after
2024-12-17 17:26:32 +01:00
command[check_disk]=/usr/lib/nagios/plugins/check_disk -x /lib/init/rw -x /dev -x /dev/shm -x /sys -x /proc -X tmpfs -w 10% -c 3% -W 10% -K 3% -A -I '^/dev/loop.*$' -I '^/run/docker/.*$' -X overlay -x /sys/kernel/debug/tracing
# -w space warning / -c space critical / -W inode warning / -K inode criticak / -C reset after
command[check_disk_advanced]=/usr/lib/nagios/plugins/check_disk_advanced -x /lib/init/rw -x /run -x /sys -x /dev/shm -X tmpfs -X nsfs -X overlay -X fuse -X proc -X sysfs -X devtmpfs -w 10% -c 3% -W 10% -K 3% -H
2024-12-16 19:24:54 +01:00
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 /
2024-12-17 17:26:32 +01:00
{% if nrpe_disk is defined %}
{% for target in nrpe_disk %}
2024-12-16 19:24:54 +01:00
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
2024-12-17 17:26:32 +01:00
{% endfor %}
{% endif %}
2024-12-16 19:24:54 +01:00
2024-12-17 17:26:32 +01:00
{% if nrpe_mysql is defined %}
2024-12-16 19:24:54 +01:00
# mysql
2024-12-17 17:26:32 +01:00
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 %}
2024-12-16 19:24:54 +01:00
2024-12-17 17:26:32 +01:00
{% if nrpe_postgresql is defined %}
2024-12-16 19:24:54 +01:00
# postgresql
2024-12-17 17:26:32 +01:00
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 %}
2024-12-16 19:24:54 +01:00
2024-12-17 17:26:32 +01:00
{% if nrpe_raid_soft is defined %}
2024-12-16 19:24:54 +01:00
command[check_mdadm]=/usr/lib/nagios/plugins/check_mdadm
2024-12-17 17:26:32 +01:00
{% endif %}
{% if nrpe_raid_3ware is defined %}
2024-12-16 19:24:54 +01:00
command[check_3ware]=/usr/bin/sudo /usr/lib/nagios/plugins/check_3ware
2024-12-17 17:26:32 +01:00
{% 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 %}
2024-12-16 19:24:54 +01:00