summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/logging/central-stats-server.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-03-05 17:01:57 +0100
committertv <tv@krebsco.de>2017-03-05 17:01:57 +0100
commit23a79b8fb02b3bebfb377f2b236432ff9a73343a (patch)
tree494bcb3bb57b397bab756aebe86e85dbd5a2a2fd /makefu/2configs/logging/central-stats-server.nix
parentfd6c056a720544319f02cf02b64fa8dd2b657aa8 (diff)
parentcb48e9371a337d23e1f3f09b5d024ee60451d9d2 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/logging/central-stats-server.nix')
-rw-r--r--makefu/2configs/logging/central-stats-server.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/makefu/2configs/logging/central-stats-server.nix b/makefu/2configs/logging/central-stats-server.nix
index 8151d4939..30ad63879 100644
--- a/makefu/2configs/logging/central-stats-server.nix
+++ b/makefu/2configs/logging/central-stats-server.nix
@@ -5,10 +5,9 @@ let
collectd-port = 25826;
influx-port = 8086;
grafana-port = 3000; # TODO nginx forward
+ db = "collectd_db";
+ logging-interface = config.makefu.server.primary-itf;
in {
- imports = [
- ../../../lass/3modules/kapacitor.nix
- ];
services.grafana.enable = true;
services.grafana.addr = "0.0.0.0";
@@ -27,11 +26,11 @@ in {
collectd = [{
enabled = true;
typesdb = "${pkgs.collectd}/share/collectd/types.db";
- database = "collectd_db";
+ database = db;
port = collectd-port;
}];
};
- lass.kapacitor =
+ krebs.kapacitor =
let
echoToIrc = pkgs.writeDash "echo_irc" ''
set -euf
@@ -43,7 +42,8 @@ in {
in {
enable = true;
alarms = {
- cpu_deadman = ''
+ cpu_deadman.database = db;
+ cpu_deadman.text = ''
var data = batch
|query(${"'''"}
SELECT mean("value") AS mean
@@ -68,5 +68,8 @@ in {
iptables -A INPUT -i retiolum -p udp --dport ${toString collectd-port} -j ACCEPT
iptables -A INPUT -i retiolum -p tcp --dport ${toString influx-port} -j ACCEPT
iptables -A INPUT -i retiolum -p tcp --dport ${toString grafana-port} -j ACCEPT
+ iptables -A INPUT -i ${logging-interface} -p udp --dport ${toString collectd-port} -j ACCEPT
+ iptables -A INPUT -i ${logging-interface} -p tcp --dport ${toString influx-port} -j ACCEPT
+ iptables -A INPUT -i ${logging-interface} -p tcp --dport ${toString grafana-port} -j ACCEPT
'';
}