Improve monitoring stuff
Some checks failed
Run nix flake check / flake-check (push) Failing after 23m19s
Some checks failed
Run nix flake check / flake-check (push) Failing after 23m19s
This commit is contained in:
parent
32425807fc
commit
a4592ffda3
@ -3,5 +3,6 @@
|
||||
imports = [
|
||||
./loki.nix
|
||||
./grafana.nix
|
||||
./prometheus.nix
|
||||
];
|
||||
}
|
||||
|
@ -2,5 +2,27 @@
|
||||
{
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
alertmanager = {
|
||||
enable = true;
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node-exporter";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
# Node exporter
|
||||
"gunter.home.2rjus.net:9100"
|
||||
"ca.home.2rjus.net:9100"
|
||||
"monitoring01.home.2rjus.net:9100"
|
||||
"ns1.home.2rjus.net:9100"
|
||||
"ns2.home.2rjus.net:9100"
|
||||
"http-proxy.home.2rjus.net:9100"
|
||||
"ha1.home.2rjus.net:9100"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@ -6,6 +6,8 @@
|
||||
server = {
|
||||
http_listen_address = "0.0.0.0";
|
||||
http_listen_port = 9099;
|
||||
grpc_listen_address = "0.0.0.0";
|
||||
grpc_listen_port = 9098;
|
||||
};
|
||||
|
||||
clients = [
|
||||
|
@ -1,33 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
prometheus-node-exporter
|
||||
prometheus-systemd-exporter
|
||||
];
|
||||
|
||||
systemd.services."node-exporter" = {
|
||||
services.prometheus.exporters.node = {
|
||||
enable = true;
|
||||
unitConfig = {
|
||||
Description = "Prometheus Node Exporter";
|
||||
After = [ "network.target" ];
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.prometheus-node-exporter}/bin/node_exporter";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
enabledCollectors = [
|
||||
"systemd"
|
||||
"logind"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."systemd-exporter" = {
|
||||
enable = true;
|
||||
unitConfig = {
|
||||
Description = "Prometheus Systemd Exporter";
|
||||
After = [ "network.target" ];
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 9100 9558 ];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user