Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 3cf06162939317595c3c8c9a979a40fceb522e57
  • master par défaut protégée
  • v1.2.1
  • v1.2.0
  • v1.1.9
  • v1.1.8
  • v1.1.7
  • v1.1.6
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.3
  • v1.0.2
  • v1.0.0
  • v1.0.1
18 résultats

nrpe.cfg.j2

Blame
  • nrpe.cfg.j2 7,65 Kio
    allow_bash_command_substitution=0
    {% if inventory_hostname in groups.docker_nagios | default([]) %}
    allowed_hosts={{ groups.docker_nagios | default([]) | map('extract', hostvars, ['ansible_host']) | join(',') }},192.168.239.2,127.0.0.1
    {% else %}
    allowed_hosts={{ groups.docker_nagios | default([]) | map('extract', hostvars, ['ansible_host']) | join(',') }},127.0.0.1
    {% endif %}
    command_timeout=60
    connection_timeout=300
    debug=0
    dont_blame_nrpe=0
    log_facility=daemon
    nrpe_user=nagios
    nrpe_group=nagios
    pid_file=/run/nagios/nrpe.pid
    server_port=5666
    
    # Generic checks
    command[check_hda1]=/usr/lib/nagios/plugins/check_disk -u GB -w 20% -c 10% -p /
    {% if raid_config is defined %}
    {% for device in raid_config.devices %}
    command[check_raid_{{ device }}]=/usr/lib/nagios/custom-plugins/check_mdstat.sh {{ device }} {{ raid_config.disks }}
    {% endfor %}
    {% endif %}
    command[check_load]=/usr/lib/nagios/plugins/check_load -r -w .85,.80,.75 -c .99,.95,.90
    command[check_mem]=/usr/lib/nagios/custom-plugins/check_mem.pl -f -C -w 20 -c 5
    {% if inventory_hostname in groups.docker | default([]) %}
    command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w {{ ((group_names | length - 7) * 20 + 370) | int | abs }} -c {{ ((group_names | length - 7) * 20 + 410) | int | abs }}
    {% else %}
    command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 290 -c 350
    {% endif %}
    command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
    command[check_version]=/usr/lib/nagios/custom-plugins/check_version.sh
    
    # Check specific processes
    {% if inventory_hostname in groups.gitlab | default([]) %}
    {% set fail2ban_jails = fail2ban_jails + ['gitlab'] %}
    {% endif %}
    {% if inventory_hostname in groups.odoo_server | default([]) or inventory_hostname in groups.owncloud_server | default([]) or inventory_hostname in groups.gitlab | default([]) %}
    {% set fail2ban_jails = fail2ban_jails + ['nginx-http-auth', 'nginx-botsearch'] %}
    {% endif %}
    {% if inventory_hostname in groups.docker | default([]) and inventory_hostname not in groups.docker_nextcloud | default([]) %}
    {% set fail2ban_jails = fail2ban_jails + ['traefik-auth'] %}
    {% endif %}
    command[check_fail2ban]=/usr/lib/nagios/custom-plugins/check_fail2ban.sh --warning 250 --critical 500 {{ fail2ban_jails | join(',') }}
    {% if inventory_hostname in groups.docker_gitlab | default([]) %}
    command[check_procs_sshd]=/usr/lib/nagios/plugins/check_procs -w 4 -c 2: -C sshd -a -D
    {% else %}
    command[check_procs_sshd]=/usr/lib/nagios/plugins/check_procs -w 2 -c 1: -C sshd -a -D
    {% endif %}
    {% if inventory_hostname in groups.odoo_server | default([]) | union(groups.owncloud_server | default([])) %}
    command[check_procs_nginx]=/usr/lib/nagios/plugins/check_procs -w 5 -c 2: -C nginx
    {% endif %}
    {% if inventory_hostname in groups.full_maintenance | default([]) %}
    command[check_procs_filebeat]=/usr/lib/nagios/plugins/check_procs -w 2 -c 1: -C filebeat
    command[check_apt]=/usr/lib/nagios/plugins/check_apt
    {% endif %}
    {% if inventory_hostname in groups.odoo_server | default([]) %}
    command[check_procs_odoo]=/usr/lib/nagios/plugins/check_procs -w 2 -c 1: -C python -a odoo-bin
    {% endif %}
    {% if inventory_hostname in groups.owncloud_server | default([]) %}
    command[check_procs_owncloud]=/usr/lib/nagios/plugins/check_procs -w 10 -c 2: -C php-fpm{{ php_version | default('7.2') }}
    {% endif %}
    
    {% if inventory_hostname in groups.backup_server | default([]) %}
    # Backup Server
    command[check_cloud_storage]=/usr/lib/nagios/custom-plugins/check_cloud_storage.sh
    command[check_odoo_storage]=/usr/lib/nagios/custom-plugins/check_odoo_storage.sh
    command[check_odoo2_storage]=/usr/lib/nagios/custom-plugins/check_odoo2_storage.sh
    
    {% endif %}
    {% if inventory_hostname in groups.docker | default([]) %}
    # Docker Containers
    command[check_docker_proxy]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^inverseproxy.*' --cpu 10:15 --memory 10:15
    {% endif %}
    {% if inventory_hostname in groups.docker_auth | default([]) %}
    command[check_docker_ldap]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '.*ldap.*' --cpu 5:10 --memory 12:17
    command[check_docker_sso]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^sso' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_drawio | default([]) %}
    command[check_docker_drawio]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^drawio.*' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_etherpad | default([]) %}
    command[check_docker_etherpad]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^etherpad.*' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_framadate | default([]) %}
    command[check_docker_framadate]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^framadate.*' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_gitlab | default([]) %}
    command[check_docker_gitlab]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^gitlab.*' --cpu 5:10 --memory 40:60
    {% endif %}
    {% if inventory_hostname in groups.docker_jitsi | default([]) %}
    command[check_docker_jitsi]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^jitsi.*' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_mattermost | default([]) %}
    command[check_docker_mattermost]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^mattermost.*' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_nagios | default([]) %}
    command[check_docker_nagios]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^nagios.*' --cpu 5:15 --memory 10:15
    {% endif %}
    {% if inventory_hostname in groups.docker_nextcloud | default([]) %}
    {% if inventory_hostname in groups.docker_odoo | default([]) %}
    command[check_docker_cloud]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^nextcloud.*' --cpu 70:80 --memory 15:25
    {% else %}
    command[check_docker_cloud]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^nextcloud.*' --cpu 70:80 --memory 65:85
    {% endif %}
    {% endif %}
    {% if inventory_hostname in groups.docker_odoo | default([]) %}
    {% if odoo_prod is defined %}
    command[check_docker_odoo]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^odoo($|_.*)' --cpu 10:15 --memory 35:45
    {% endif %}
    {% for instance in odoo_nonprod_instances | default([]) %}
    command[check_docker_{{ instance.name }}]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^{{ instance.dir }}.*' --cpu 10:15 --memory 20:25
    {% endfor %}
    {% if restrict_internet_access and whitelisted_urls is defined %}
    command[check_docker_whitelists]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^whitelists.*' --cpu 10:10 --memory 5:7
    {% endif %}
    {% endif %}
    {% if inventory_hostname in groups.docker_owncloud | default([]) %}
    {% if inventory_hostname in groups.docker_odoo | default([]) %}
    command[check_docker_cloud]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^owncloud.*' --cpu 70:80 --memory 15:25
    {% else %}
    command[check_docker_cloud]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^owncloud.*' --cpu 70:80 --memory 65:55
    {% endif %}
    {% endif %}
    {% if inventory_hostname in groups.docker_privatebin | default([]) %}
    command[check_docker_privatebin]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^privatebin' --cpu 5:10 --memory 7:12
    {% endif %}
    {% if inventory_hostname in groups.docker_tuleap | default([]) %}
    command[check_docker_tuleap]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^tuleap.*' --cpu 5:10 --memory 9:14
    {% endif %}
    {% if inventory_hostname in groups.gitlab | default([]) %}
    command[check_gitlab_services]=/usr/lib/nagios/custom-plugins/check_gitlab.rb -m services
    command[check_gitlab_health]=/usr/lib/nagios/custom-plugins/check_gitlab.rb -m health -k -H https://localhost
    {% endif %}