hosts/library: extract prometheus config
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./grafana.nix
|
./grafana.nix
|
||||||
|
./prometheus.nix
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -47,35 +48,6 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.prometheus = {
|
|
||||||
enable = true;
|
|
||||||
port = 9001;
|
|
||||||
exporters = {
|
|
||||||
node = {
|
|
||||||
enable = true;
|
|
||||||
enabledCollectors = [ "systemd" ];
|
|
||||||
port = 9002;
|
|
||||||
};
|
|
||||||
zfs = {
|
|
||||||
enable = true;
|
|
||||||
port = 9003;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
scrapeConfigs = [
|
|
||||||
{
|
|
||||||
job_name = "node";
|
|
||||||
static_configs = [
|
|
||||||
{
|
|
||||||
targets = [
|
|
||||||
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
|
||||||
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.vps1-tunnel = {
|
systemd.services.vps1-tunnel = {
|
||||||
enable = true;
|
enable = true;
|
||||||
description = "vps1.mesh.vimium.net SSH tunnel";
|
description = "vps1.mesh.vimium.net SSH tunnel";
|
||||||
|
35
hosts/library/prometheus.nix
Normal file
35
hosts/library/prometheus.nix
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
port = 9002;
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
enable = true;
|
||||||
|
port = 9003;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = [
|
||||||
|
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
||||||
|
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user