diff --git a/roles/common/templates/nrpe_local.cfg b/roles/common/templates/nrpe_local.cfg index 3d7209c..b20a35a 100644 --- a/roles/common/templates/nrpe_local.cfg +++ b/roles/common/templates/nrpe_local.cfg @@ -1,23 +1,23 @@ command[check_ssh]=/usr/lib64/nagios/plugins/check_ssh -H 127.0.0.1 command[check_ssh_phab]=/usr/lib64/nagios/plugins/check_ssh -H 127.0.0.1 -p {{ vcs_port }} command[check_disk_vda]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/vda1 command[check_disk_vdb]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/vdb command[check_disk_repo]=/usr/lib64/nagios/plugins/check_disk -X ext4 {{ repositories_path }} command[check_http_phab]=/usr/lib64/nagios/plugins/check_http -I {{ inventory_hostname }} -H {{ domain }} -u /status/ -r ALIVE command[check_http_ex_phab]=/usr/lib64/nagios/plugins/check_http -H {{ domain }} -e 'HTTP/1.1 302 Found' command[check_http_ex_phab_ssl]=/usr/lib64/nagios/plugins/check_http -H {{ domain }} --ssl -u /status/ -r ALIVE command[check_http_jenkins]=/usr/lib64/nagios/plugins/check_http -H jenkins.{{ domain }} --ssl -command[check_mysql_remote]=/usr/lib64/nagios/plugins/check_mysql -H {{ internal_ip }} -u {{ mysql_app_user }} -p {{ mysql_app_pass }} +command[check_mysql_remote]=/usr/lib64/nagios/plugins/check_mysql -H $ARG1$ -u {{ mysql_app_user }} -p {{ mysql_app_pass }} command[check_mysql_local]=/usr/lib64/nagios/plugins/check_mysql -u root command[check_phd]=/usr/lib64/nagios/plugins/check_procs -C 'php' -a {{ phabricator_path }}phabricator/scripts/daemon/phd-daemon command[check_gluster]=/usr/lib64/nagios/plugins/check_procs -C 'glusterd' -c 1 command[check_gmond]=/usr/lib64/nagios/plugins/check_procs -C 'gmond' -c 1 command[check_gmetad]=/usr/lib64/nagios/plugins/check_procs -C 'gmetad' -c 1 command[check_httpd]=/usr/lib64/nagios/plugins/check_procs -C 'httpd' -c 1: command[check_java_jenkins]=/usr/lib64/nagios/plugins/check_procs -C 'java' -c 1 command[check_shibd]=/usr/lib64/nagios/plugins/check_procs -C 'shibd' -c 1 command[check_shib_status]=/usr/lib64/nagios/plugins/check_http -H localhost -u /Shibboleth.sso/Status -R '' command[check_postfix_master]=/usr/lib64/nagios/plugins/check_procs -C master -a '-w' -c 1 command[check_postfix_pickup]=/usr/lib64/nagios/plugins/check_procs -C pickup -c 1 command[check_postfix_qmgr]=/usr/lib64/nagios/plugins/check_procs -C qmgr -c 1 command[check_mem]=/usr/local/bin/check_mem.sh -w 95 -c 98 -W 50 -C 90 diff --git a/roles/nagios/templates/services.cfg b/roles/nagios/templates/services.cfg index dbf644f..ec6ab15 100644 --- a/roles/nagios/templates/services.cfg +++ b/roles/nagios/templates/services.cfg @@ -1,281 +1,283 @@ define service { name custom-service use generic-service contact_groups c4science_admins notification_interval 10080 register 0 } ### Common ### {% for host in groups['all'] %} {% if hostvars[host]['host_name'] is defined and hostvars[host]['host_name'] != 'c4science-ci-slave00' %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description CPU Load check_command check_nrpe!check_load } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description SSH check_command check_nrpe!check_ssh } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Disk Usage vda1 check_command check_nrpe!check_disk_vda } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Memory usage check_command check_nrpe!check_mem } {% if hostvars[host]['host_name'] != 'c4science-backup' %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Ganglia check_command check_nrpe!check_gmond } {% endif %} {% endif %} {% endfor %} ### FS ### {% for host in groups['fs'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Gluster Daemon check_command check_nrpe!check_gluster } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Disk Usage vdb check_command check_nrpe!check_disk_vdb } {% endif %} {% endfor %} ### APP ### {% for host in groups['app'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Disk repo mount check_command check_nrpe!check_disk_repo } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description SSH Phabricator check_command check_nrpe!check_ssh_phab } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description HTTP Phabricator check_command check_nrpe!check_http_phab } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Apache check_command check_nrpe!check_httpd } +{% for db_host in groups['dbs'] %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} - service_description MySQL Remote - check_command check_nrpe!check_mysql_remote + service_description MySQL Remote {{ db_host }} + check_command check_nrpe!check_mysql_remote!{{ db_host }} } +{% endfor %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Shibboleth daemon check_command check_nrpe!check_shibd } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Shibboleth Status check_command check_nrpe!check_shib_status } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Postfix Mailer check_command check_nrpe!check_postfix_master } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Postfix Pickup check_command check_nrpe!check_postfix_pickup } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Postfix Queue check_command check_nrpe!check_postfix_qmgr } {% endif %} {% endfor %} ### PHD DAEMONS ### {% for host in groups['phd'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Disk repo mount check_command check_nrpe!check_disk_repo } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Phabricator Daemon check_command check_nrpe!check_phd } {% endif %} {% endfor %} ### LOAD BALANCER ### {% for host in groups['lbs'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description HTTP Phabricator check_command check_nrpe!check_http_ex_phab } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description HTTP Phabricator SSL check_command check_nrpe!check_http_ex_phab_ssl } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description HTTP Jenkins check_command check_nrpe!check_http_jenkins } {% endif %} {% endfor %} ### CI ### {% for host in groups['ci'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description HTTP Jenkins check_command check_nrpe!check_http_jenkins } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Java Jenkins check_command check_nrpe!check_java_jenkins } {% endif %} {% endfor %} define service{ use custom-service host_name c4science-ci-slave00 service_description CPU Load check_command check_nrpe!check_load } define service{ use custom-service host_name c4science-ci-slave00 service_description Disk Usage vdb check_command check_nrpe!check_disk_vdb } define service{ use custom-service host_name c4science-ci-slave00 service_description Memory usage check_command check_nrpe!check_mem } define service{ use custom-service host_name c4science-ci-slave00 service_description Docker daemon check_command check_nrpe!check_docker_daemon } ### MONIT ### {% for host in groups['monit'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Ganglia server check_command check_nrpe!check_gmetad } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Apache check_command check_nrpe!check_httpd } {% endif %} {% endfor %} ### Databases ### {% for host in groups['dbs'] %} {% if hostvars[host]['host_name'] is defined %} define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description MySQL check_command check_nrpe!check_mysql_local } define service{ use custom-service host_name {{ hostvars[host]['host_name'] }} service_description Disk Usage vdb check_command check_nrpe!check_disk_vdb } {% endif %} {% endfor %}