diff options
| author | Paul Buetow <paul@buetow.org> | 2023-04-20 22:44:33 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-04-20 22:44:33 +0300 |
| commit | c2696c6de04d144ba77d4a4637c47d3fd461172b (patch) | |
| tree | 8a8052f56ea1cd711cf57e385ed01b4b9f411991 | |
| parent | 83778a72cad7924d270f6dd4c8417c241d52efc9 (diff) | |
installing gogios
| -rw-r--r-- | frontends/Rexfile | 25 | ||||
| -rw-r--r-- | frontends/etc/gogios.json.tpl | 4 |
2 files changed, 24 insertions, 5 deletions
diff --git a/frontends/Rexfile b/frontends/Rexfile index 1b4c692..a9bde17 100644 --- a/frontends/Rexfile +++ b/frontends/Rexfile @@ -387,9 +387,21 @@ task 'dtail', group => 'frontends', service 'dserver', ensure => 'started'; }; +desc 'Installing Gogios binary'; +task 'gogios_install', group => 'frontends', + sub { + file '/usr/local/bin/gogios', + source => 'usr/local/bin/gogios', + mode => '0755'; + owner => 'root', + group => 'root'; + }; + desc 'Setup Gogios monitoring system'; task 'gogios', group => 'frontends', sub { + my $gogios_path = '/usr/local/bin/gogios'; + file '/etc/gogios.json', content => template('./etc/gogios.json.tpl', acme_hosts => \@acme_hosts), @@ -397,14 +409,21 @@ task 'gogios', group => 'frontends', group => 'wheel', mode => '744'; - run 'adduser -group _gogios -batch _gogios', unless => 'id _gogios'; - run 'usermod -d /var/run/gogios _gogios'; - file '/var/run/gogios', ensure => 'directory', owner => '_gogios', group => '_gogios', mode => '755'; + + unless (is_file($gogios_path)) { + Rex::Logger::info("Gogios not installed to $gogios_path! Run task 'gogios_install'", 'error'); + } + + run 'adduser -group _gogios -batch _gogios', unless => 'id _gogios'; + run 'usermod -d /var/run/gogios _gogios'; + + run "echo '*/10 * * * * $gogios_path -cfg /etc/gogios.conf >/dev/null' | crontab -u _gogios -", + unless => 'crontab -l -u _gogios | grep $gogios_path'; }; desc 'Setup IRC bouncer'; diff --git a/frontends/etc/gogios.json.tpl b/frontends/etc/gogios.json.tpl index 50e8b66..33a2147 100644 --- a/frontends/etc/gogios.json.tpl +++ b/frontends/etc/gogios.json.tpl @@ -1,8 +1,8 @@ { "EmailTo": "paul", "EmailFrom": "gogios@mx.buetow.org", - "CheckTimeoutS": 4, - "CheckConcurrency": 10, + "CheckTimeoutS": 10, + "CheckConcurrency": 2, "StateDir": "/var/run/gogios", "Checks": { <% for my $host (@$acme_hosts) { -%> |
