From e3e859c14eb34bc045544ff64c3340b9f4dbe1f0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 5 Sep 2021 18:38:13 +0200 Subject: brockman: 3.4.5 -> 4.0.1 --- krebs/5pkgs/haskell/brockman/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/haskell/brockman/default.nix b/krebs/5pkgs/haskell/brockman/default.nix index ef9f36217..d3dbcd89c 100644 --- a/krebs/5pkgs/haskell/brockman/default.nix +++ b/krebs/5pkgs/haskell/brockman/default.nix @@ -7,12 +7,12 @@ }: mkDerivation rec { pname = "brockman"; - version = "3.4.5"; + version = "4.0.1"; src = fetchFromGitHub { owner = "kmein"; repo = "brockman"; rev = version; - sha256 = "1q56ibgijcz6fgd60h0d1f2020l4n2i2nh98yaq95zhzwg0qsciy"; + sha256 = "0hppgban8hfyhn4c8qgm8j7ml6jaa35pjgrv3k3q27ln71wnr8rz"; }; isLibrary = false; isExecutable = true; -- cgit v1.2.3 From 5dbb36955870955f643c89d65430d2440e747e3a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 5 Sep 2021 20:22:06 +0200 Subject: l prism.r: add telegraf.nix --- lass/1systems/prism/config.nix | 3 +- lass/2configs/telegraf.nix | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 lass/2configs/telegraf.nix diff --git a/lass/1systems/prism/config.nix b/lass/1systems/prism/config.nix index 421afab2a..6ce4332da 100644 --- a/lass/1systems/prism/config.nix +++ b/lass/1systems/prism/config.nix @@ -7,11 +7,12 @@ with import ; + + { services.nginx.enable = true; imports = [ - ]; # needed by domsen.nix ^^ lass.usershadow = { diff --git a/lass/2configs/telegraf.nix b/lass/2configs/telegraf.nix new file mode 100644 index 000000000..4f46cd721 --- /dev/null +++ b/lass/2configs/telegraf.nix @@ -0,0 +1,67 @@ +{ config, lib, pkgs, ... }: +let + isVM = lib.any (mod: mod == "xen-blkfront" || mod == "virtio_console") config.boot.initrd.kernelModules; +in { + + krebs.iptables.tables.filter.INPUT.rules = [ + { predicate = "-i retiolum -p tcp --dport 9273"; target = "ACCEPT"; } + ]; + + systemd.services.telegraf.path = [ pkgs.nvme-cli ]; + + services.telegraf = { + enable = true; + extraConfig = { + agent.interval = "60s"; + inputs = { + prometheus.metric_version = 2; + kernel_vmstat = { }; + # smart = lib.mkIf (!isVM) { + # path = pkgs.writeShellScript "smartctl" '' + # exec /run/wrappers/bin/sudo ${pkgs.smartmontools}/bin/smartctl "$@" + # ''; + # }; + system = { }; + mem = { }; + file = [{ + data_format = "influx"; + file_tag = "name"; + files = [ "/var/log/telegraf/*" ]; + }] ++ lib.optional (lib.any (fs: fs == "ext4") config.boot.supportedFilesystems) { + name_override = "ext4_errors"; + files = [ "/sys/fs/ext4/*/errors_count" ]; + data_format = "value"; + }; + exec = lib.optionalAttrs (lib.any (fs: fs == "zfs") config.boot.supportedFilesystems) { + ## Commands array + commands = [ + (pkgs.writeScript "zpool-health" '' + #!${pkgs.gawk}/bin/awk -f + BEGIN { + while ("${pkgs.zfs}/bin/zpool status" | getline) { + if ($1 ~ /pool:/) { printf "zpool_status,name=%s ", $2 } + if ($1 ~ /state:/) { printf " state=\"%s\",", $2 } + if ($1 ~ /errors:/) { + if (index($2, "No")) printf "errors=0i\n"; else printf "errors=%di\n", $2 + } + } + } + '') + ]; + data_format = "influx"; + }; + systemd_units = { }; + swap = { }; + disk.tagdrop = { + fstype = [ "tmpfs" "ramfs" "devtmpfs" "devfs" "iso9660" "overlay" "aufs" "squashfs" ]; + device = [ "rpc_pipefs" "lxcfs" "nsfs" "borgfs" ]; + }; + diskio = { }; + }; + outputs.prometheus_client = { + listen = ":9273"; + metric_version = 2; + }; + }; + }; +} -- cgit v1.2.3 From 87c758f629ce70addf40f0509b8a7856fe0f0da4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 5 Sep 2021 21:27:30 +0200 Subject: puyak: add shackie reaktor irc bot --- krebs/1systems/puyak/config.nix | 3 +++ krebs/2configs/shack/reaktor.nix | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 krebs/2configs/shack/reaktor.nix diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 2f122f6ff..1dcf20308 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -115,6 +115,9 @@ ## Collect local statistics via collectd and send to collectd + + ## shackie irc bot + ]; krebs.build.host = config.krebs.hosts.puyak; diff --git a/krebs/2configs/shack/reaktor.nix b/krebs/2configs/shack/reaktor.nix new file mode 100644 index 000000000..40c121299 --- /dev/null +++ b/krebs/2configs/shack/reaktor.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +{ + krebs.reaktor2.shackie = { + hostname = "irc.libera.chat"; + port = "6697"; + nick = "shackie"; + API.listen = "inet://127.0.0.1:7777"; + plugins = [ + { + plugin = "register"; + config = { + channels = [ + "#shackspace" + ]; + }; + } + ]; + }; +} -- cgit v1.2.3 From 06e751c4bbbe4812d6b8c4cf0a964098a68e7b50 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 5 Sep 2021 21:28:13 +0200 Subject: puyak.r: remove legacy cryptoModules --- krebs/1systems/puyak/config.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 1dcf20308..ce355998f 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -127,7 +127,6 @@ loader.efi.canTouchEfiVariables = true; initrd.luks.devices.luksroot.device = "/dev/sda3"; - initrd.luks.cryptoModules = [ "aes" "sha512" "sha1" "xts" ]; initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ]; kernelModules = [ "kvm-intel" ]; -- cgit v1.2.3