snmp: from package back to module
This commit is contained in:
parent
dae3c590ce
commit
5c1cccb8a4
@ -173,7 +173,5 @@
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
|
||||
packages.snmp-yaml = pkgs.callPackage ./packages/snmp-yaml {};
|
||||
});
|
||||
}
|
||||
|
@ -100,6 +100,8 @@
|
||||
|
||||
gitea.enable = true;
|
||||
|
||||
snmp_exporter.enable = true;
|
||||
|
||||
headscale = {
|
||||
enable = true;
|
||||
clientOidcPath = config.age.secrets.headscale-client-oidc.path;
|
||||
@ -300,12 +302,6 @@
|
||||
evaluation_interval = "15s";
|
||||
};
|
||||
|
||||
exporters.snmp = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
configuration = {};
|
||||
};
|
||||
|
||||
scrapeConfigs = let
|
||||
port = builtins.toString myData.ports.exporters.node;
|
||||
in [
|
||||
|
@ -13,6 +13,7 @@
|
||||
./node_exporter
|
||||
./nsd-acme
|
||||
./postfix
|
||||
./snmp_exporter
|
||||
./syncthing
|
||||
./zfsunlock
|
||||
];
|
||||
|
21
modules/services/snmp_exporter/default.nix
Normal file
21
modules/services/snmp_exporter/default.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
myData,
|
||||
...
|
||||
}: {
|
||||
options.mj.services.snmp_exporter = with lib.types; {
|
||||
enable = lib.mkEnableOption "Enable prometheus snmp_exporter";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mj.services.snmp_exporter.enable {
|
||||
mj.services.friendlyport.vpn.ports = [config.services.prometheus.exporters.snmp.port];
|
||||
|
||||
services.prometheus.exporters.snmp = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
configurationPath = ./snmp.yml;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
stdenv,
|
||||
pkgs,
|
||||
prometheus-snmp-exporter,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "snmp-yaml";
|
||||
inherit (prometheus-snmp-exporter) version src;
|
||||
|
||||
buildInputs = [prometheus-snmp-exporter];
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p $out
|
||||
set -x
|
||||
cd $src/generator
|
||||
${prometheus-snmp-exporter}/bin/generator generate \
|
||||
--output-path=$out/snmp.yml
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user