From 4bf02aedd3c993305346ef1f0781600344588a71 Mon Sep 17 00:00:00 2001 From: Salt Date: Tue, 7 Sep 2021 16:11:11 -0500 Subject: [PATCH] Add even more checks for zerotier and psql --- playbooks/tasks/web/nagios.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/playbooks/tasks/web/nagios.yml b/playbooks/tasks/web/nagios.yml index 98f4d05..824578e 100644 --- a/playbooks/tasks/web/nagios.yml +++ b/playbooks/tasks/web/nagios.yml @@ -56,21 +56,27 @@ - name: Unit ansible-pull.timer command: check_by_ssh!/usr/local/bin/monitoring-scripts/check_systemd_unit ansible-pull.timer hostgroup: ansible-pull - # zerotier - - name: Unit zerotier-one.service - command: check_by_ssh!/usr/local/bin/monitoring-scripts/check_systemd_unit zerotier-one.service - hostgroup: zerotier + # docker + # Strictly speaking not a tag, but it's best to keep it separated + # TODO: Figure out how I'm going to implement Docker checks # nagios-checkpgsql - - name: PostgreSQL + - name: PSQL command: "check_by_ssh!/usr/lib/nagios/plugins/check_pgsql -H localhost -l nagios -p {{ secret_postgresql_monitoring_password }} -w 2 -c 5" hostgroup: nagios-checkpgsql + - name: PSQL Connections + command: "check_by_ssh!/usr/lib/nagios/plugins/check_pgsql -H localhost -l nagios -p {{ secret_postgresql_monitoring_password }} -w 2 -c 5 -q 'select (select count(*)::float used from pg_stat_activity) / (select setting::int max_conn from pg_settings where name=$$max_connections$$);' -W 0.5-0.7 -C 0.7-1.0" + hostgroup: nagios-checkpgsql - name: Unit postgresql.service - command: check_by_postgresql!/usr/local/bin/monitoring-scripts/check_systemd_unit postgresql.service + command: check_by_ssh!/usr/local/bin/monitoring-scripts/check_systemd_unit postgresql.service hostgroup: nagios-checkpgsql # nagios-nrpeswap - name: Swap Usage command: check_by_ssh!/usr/lib/nagios/plugins/check_swap -w 20% -c 10% hostgroup: nagios-nrpeswap + # zerotier + - name: Unit zerotier-one.service + command: check_by_ssh!/usr/local/bin/monitoring-scripts/check_systemd_unit zerotier-one.service + hostgroup: zerotier register: config tags: [ nagios, template ] - name: assure config file is loaded