From 18badcd7c6b196095214ea1cbc9141e19f3cba03 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 2 Sep 2019 13:56:03 +0200 Subject: puyak.r,wolf.r: configure monitoring for shack infra --- krebs/2configs/collectd-base.nix | 41 ------------------- krebs/2configs/stats/shack-client.nix | 60 ++++++++++++++++++++++++++++ krebs/2configs/stats/shack-debugging.nix | 41 +++++++++++++++++++ krebs/2configs/stats/wolf-client.nix | 68 -------------------------------- 4 files changed, 101 insertions(+), 109 deletions(-) delete mode 100644 krebs/2configs/collectd-base.nix create mode 100644 krebs/2configs/stats/shack-client.nix create mode 100644 krebs/2configs/stats/shack-debugging.nix delete mode 100644 krebs/2configs/stats/wolf-client.nix (limited to 'krebs/2configs') diff --git a/krebs/2configs/collectd-base.nix b/krebs/2configs/collectd-base.nix deleted file mode 100644 index 71a00be3a..000000000 --- a/krebs/2configs/collectd-base.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, pkgs, ... }: - -# TODO: krebs.collectd.plugins -with import ; -let - connect-time-cfg = with pkgs; writeText "collectd-connect-time.conf" '' - LoadPlugin python - - ModulePath "${collectd-connect-time}/lib/${python.libPrefix}/site-packages/" - Import "collectd_connect_time" - - target "localhost:22" "google.com" "google.de" "gum.r:22" "gum.krebsco.de" "10.42.0.1:22" "heise.de" "t-online.de" - interval 10 - - - ''; - graphite-cfg = pkgs.writeText "collectd-graphite.conf" '' - LoadPlugin write_graphite - - - Host "wolf.r" - Port "2003" - Prefix "retiolum." - EscapeCharacter "_" - StoreRates false - AlwaysAppendDS false - - - ''; -in { - imports = [ ]; - - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - collectd = pkgs.collectd.override { python= pkgs.python; }; - }; - services.collectd = { - enable = true; - include = [ (toString connect-time-cfg) (toString graphite-cfg) ]; - }; - -} diff --git a/krebs/2configs/stats/shack-client.nix b/krebs/2configs/stats/shack-client.nix new file mode 100644 index 000000000..ceb7d9edd --- /dev/null +++ b/krebs/2configs/stats/shack-client.nix @@ -0,0 +1,60 @@ +{pkgs, config, ...}: +{ + services.collectd = { + enable = true; + autoLoadPlugin = true; + extraConfig = '' + Hostname ${config.krebs.build.host.name} + LoadPlugin load + LoadPlugin disk + LoadPlugin memory + LoadPlugin df + Interval 30.0 + + LoadPlugin interface + + Interface "*Link" + Interface "lo" + Interface "vboxnet*" + Interface "virbr*" + IgnoreSelected true + + + LoadPlugin df + + MountPoint "/nix/store" + # MountPoint "/run*" + # MountPoint "/sys*" + # MountPoint "/dev" + # MountPoint "/dev/shm" + # MountPoint "/tmp" + FSType "tmpfs" + FSType "binfmt_misc" + FSType "debugfs" + FSType "mqueue" + FSType "hugetlbfs" + FSType "systemd-1" + FSType "cgroup" + FSType "securityfs" + FSType "ramfs" + FSType "proc" + FSType "devpts" + FSType "devtmpfs" + MountPoint "/var/lib/docker/devicemapper" + IgnoreSelected true + + + LoadPlugin cpu + + ReportByCpu true + ReportByState true + ValuesPercentage true + + + LoadPlugin network + + Server "influx.shack" "25826" + + ''; + }; +} diff --git a/krebs/2configs/stats/shack-debugging.nix b/krebs/2configs/stats/shack-debugging.nix new file mode 100644 index 000000000..b5a0cf05e --- /dev/null +++ b/krebs/2configs/stats/shack-debugging.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: + +# TODO: krebs.collectd.plugins +with import ; +let + connect-time-cfg = with pkgs; writeText "collectd-connect-time.conf" '' + LoadPlugin python + + ModulePath "${collectd-connect-time}/lib/${python.libPrefix}/site-packages/" + Import "collectd_connect_time" + + target "localhost:22" "google.com" "google.de" "gum.krebsco.de" "10.42.0.1:22" "heise.de" "t-online.de""10.0.1.3" "10.0.0.3:22" "10.0.0.4:22" + interval 10 + + + ''; + graphite-cfg = pkgs.writeText "collectd-graphite.conf" '' + LoadPlugin write_graphite + + + Host "graphite.shack" + Port "2003" + Prefix "retiolum." + EscapeCharacter "_" + StoreRates false + AlwaysAppendDS false + + + ''; +in { + imports = [ ]; + + nixpkgs.config.packageOverrides = pkgs: with pkgs; { + collectd = pkgs.collectd.override { python= pkgs.python; }; + }; + services.collectd = { + enable = true; + include = [ (toString connect-time-cfg) (toString graphite-cfg) ]; + }; + +} diff --git a/krebs/2configs/stats/wolf-client.nix b/krebs/2configs/stats/wolf-client.nix deleted file mode 100644 index 0412eba9a..000000000 --- a/krebs/2configs/stats/wolf-client.nix +++ /dev/null @@ -1,68 +0,0 @@ -{pkgs, config, ...}: -{ - services.collectd = { - enable = true; - autoLoadPlugin = true; - extraConfig = '' - Hostname ${config.krebs.build.host.name} - LoadPlugin load - LoadPlugin disk - LoadPlugin memory - LoadPlugin df - Interval 30.0 - - LoadPlugin interface - - Interface "*Link" - Interface "lo" - Interface "vboxnet*" - Interface "virbr*" - IgnoreSelected true - - - LoadPlugin df - - MountPoint "/nix/store" - # MountPoint "/run*" - # MountPoint "/sys*" - # MountPoint "/dev" - # MountPoint "/dev/shm" - # MountPoint "/tmp" - FSType "tmpfs" - FSType "binfmt_misc" - FSType "debugfs" - FSType "mqueue" - FSType "hugetlbfs" - FSType "systemd-1" - FSType "cgroup" - FSType "securityfs" - FSType "ramfs" - FSType "proc" - FSType "devpts" - FSType "devtmpfs" - MountPoint "/var/lib/docker/devicemapper" - IgnoreSelected true - - - LoadPlugin cpu - - ReportByCpu true - ReportByState true - ValuesPercentage true - - - LoadPlugin network - - Server "stats.makefu.r" "25826" - - - LoadPlugin curl - - - URL "http://smarthome.shack/"; - MeasureResponseTime true - - - ''; - }; -} -- cgit v1.2.3