modules: refactor telegraf

This commit is contained in:
zowoq 2024-05-04 18:51:58 +10:00
parent 4726c2562c
commit 21c49c5357
4 changed files with 21 additions and 5 deletions
modules

View file

@ -1,11 +1,14 @@
{ pkgs, ... }:
{
imports = [
../../shared/telegraf.nix
];
services.telegraf = {
enable = true;
extraConfig = {
agent.interval = "60s";
inputs = {
prometheus.metric_version = 2;
smart.path_smartctl = "${pkgs.smartmontools}/bin/smartctl";
system = { };
mem = { };

View file

@ -7,9 +7,9 @@
./reboot.nix
./security.nix
./sops-nix.nix
./telegraf.nix
./users.nix
inputs.sops-nix.nixosModules.sops
inputs.srvos.nixosModules.mixins-telegraf
inputs.srvos.nixosModules.server
];
@ -24,9 +24,6 @@
Restart = "on-failure";
};
networking.firewall.allowedTCPPorts = [ 9273 ];
services.telegraf.extraConfig.inputs.prometheus.metric_version = 2;
srvos.flake = inputs.self;
boot.kernelPackages = pkgs.lib.mkIf (!config.boot.supportedFilesystems.zfs or false) pkgs.linuxPackages_latest;

View file

@ -0,0 +1,9 @@
{ inputs, ... }:
{
imports = [
inputs.srvos.nixosModules.mixins-telegraf
../../shared/telegraf.nix
];
networking.firewall.allowedTCPPorts = [ 9273 ];
}

View file

@ -0,0 +1,7 @@
{
services.telegraf.extraConfig.inputs = {
prometheus = {
metric_version = 2;
};
};
}