From 75bf57c131329b163e6023d3e330c5a7b3501c7d Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Tue, 30 May 2023 15:51:36 -0500 Subject: [PATCH] Adding checks on AniNIX/Grimoire to Core --- roles/Sharingan/files/monit/checks/grimoire | 3 ++ roles/Sharingan/files/monit/hostdefs/Core | 3 +- roles/WebServer/files/conf.d/Core/nginx.conf | 37 -------------------- 3 files changed, 5 insertions(+), 38 deletions(-) create mode 100644 roles/Sharingan/files/monit/checks/grimoire delete mode 100644 roles/WebServer/files/conf.d/Core/nginx.conf diff --git a/roles/Sharingan/files/monit/checks/grimoire b/roles/Sharingan/files/monit/checks/grimoire new file mode 100644 index 0000000..4fcaf32 --- /dev/null +++ b/roles/Sharingan/files/monit/checks/grimoire @@ -0,0 +1,3 @@ +check program check_grimoire with path "/usr/lib/monitoring-plugins/check_tcp -H localhost -p 5432" + if status != 0 for 1 times within 5 cycles then exec "/usr/bin/systemctl restart grimoire" + if status != 0 for 3 times within 5 cycles then exec "/etc/monit.d/scripts/critical CRITICAL: Grimoire startup is failing -- manual intervention needed." diff --git a/roles/Sharingan/files/monit/hostdefs/Core b/roles/Sharingan/files/monit/hostdefs/Core index 6fa1c5f..4415ee4 100644 --- a/roles/Sharingan/files/monit/hostdefs/Core +++ b/roles/Sharingan/files/monit/hostdefs/Core @@ -1,3 +1,4 @@ +include "/etc/monit.d/checks/system" include "/etc/monit.d/checks/watcher-of-watchers" include "/etc/monit.d/checks/warrant-canary" -include "/etc/monit.d/checks/system" +include "/etc/monit.d/checks/grimoire" diff --git a/roles/WebServer/files/conf.d/Core/nginx.conf b/roles/WebServer/files/conf.d/Core/nginx.conf deleted file mode 100644 index cde20d3..0000000 --- a/roles/WebServer/files/conf.d/Core/nginx.conf +++ /dev/null @@ -1,37 +0,0 @@ -user http; -worker_processes 4; - -# Logs -error_log logs/error.log; -error_log logs/error.log notice; -error_log logs/error.log info; - -events { - worker_connections 1024; -} - - -http { - - include mime.types; - include fastcgi.conf; - default_type application/octet-stream; - - server_tokens off; - sendfile on; - keepalive_timeout 65; - gzip on; - - # Redirect all HTTP to HTTPS - server { - - listen 80 default_server; - listen [::]:80 default_server; - server_name _; - location / { - return 301 https://$host$request_uri; - } - } - - include ../conf.d/*.conf; -}