summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontends/Rexfile14
-rw-r--r--frontends/etc/gogios.json.tpl24
2 files changed, 37 insertions, 1 deletions
diff --git a/frontends/Rexfile b/frontends/Rexfile
index 08fd90a..d7e9605 100644
--- a/frontends/Rexfile
+++ b/frontends/Rexfile
@@ -96,7 +96,7 @@ task 'base', group => 'frontends',
pkg 'vger', ensure => present;
pkg 'zsh', ensure => present;
- my @pkg_scripts = qw/uptimed httpd dserver/;
+ my @pkg_scripts = qw/uptimed httpd dserver icinga2/;
push @pkg_scripts, 'znc' if connection->server eq $ircbouncer_server;
my $pkg_scripts = join ' ', @pkg_scripts;
append_if_no_such_line '/etc/rc.conf.local', "pkg_scripts=\"$pkg_scripts\"";
@@ -384,6 +384,17 @@ task 'dtail', group => 'frontends',
service 'dserver', ensure => 'started';
};
+desc 'Setup Gogios monitoring system';
+task 'gogios', group => 'frontends',
+ sub {
+ file '/etc/gogios.json',
+ content => template('./etc/gogios.json.tpl',
+ acme_hosts => \@acme_hosts),
+ owner => 'root',
+ group => 'wheel',
+ mode => '755';
+ };
+
desc 'Setup IRC bouncer';
task 'ircbouncer', group => 'ircbouncer',
sub {
@@ -408,6 +419,7 @@ task 'commons', group => 'frontends',
relayd();
smtpd();
rsync();
+ gogios();
# Requires manually installing the binary!
# dtail();
};
diff --git a/frontends/etc/gogios.json.tpl b/frontends/etc/gogios.json.tpl
new file mode 100644
index 0000000..4c35bf6
--- /dev/null
+++ b/frontends/etc/gogios.json.tpl
@@ -0,0 +1,24 @@
+{
+ "EmailTo": "paul",
+ "EmailFrom": "gogios@mx.buetow.org",
+ "CheckTimeoutS": 10,
+ "CheckConcurrency": 2,
+ "Checks": {
+ <% for my $host (@$acme_hosts) { -%>
+ <% for my $prefix ('', 'www.') { -%>
+ "<%= $prefix . $host %> HTTP IPv4": {
+ "Plugin": "/usr/local/libexec/nagios/check_http",
+ "Args": ["<%= $prefix . $host %>", "-4"]
+ },
+ "<%= $prefix . $host %> HTTP IPv6": {
+ "Plugin": "/usr/local/libexec/nagios/check_http",
+ "Args": ["<%= $prefix . $host %>", "-6"]
+ },
+ <% } -%>
+ <% } -%>
+ "hasn foo.zone HTTP IPv6": {
+ "Plugin": "/usr/local/libexec/nagios/check_http",
+ "Args": ["foo.zone", "-6"]
+ }
+ }
+}