add postgres monitoring
This commit is contained in:
parent
c2b164bddd
commit
92f0120c47
|
@ -72,6 +72,13 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
services.prometheus.exporters.postgres = {
|
||||
enable = true;
|
||||
port = 9101;
|
||||
runAsLocalSuperUser = true;
|
||||
openFirewall = true;
|
||||
firewallFilter = "-i wg-monitoring -p tcp -m tcp --dport 9101";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
services.nginx = {
|
||||
|
|
14
hosts/kaon/auxMonHosts.nix
Normal file
14
hosts/kaon/auxMonHosts.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ }:
|
||||
|
||||
rec {
|
||||
|
||||
postgresExporter = [
|
||||
"kaon.mon.entr0py.de:9101"
|
||||
"luxon.mon.entr0py.de:9101"
|
||||
"geon.mon.entr0py.de:9101"
|
||||
];
|
||||
|
||||
synapseExporter = [
|
||||
"luxon.mon.entr0py.de:9123"
|
||||
];
|
||||
}
|
|
@ -23,10 +23,12 @@ let
|
|||
"${host.config.networking.hostName}.mon.entr0py.de:9100")
|
||||
monitoringHosts;
|
||||
|
||||
auxHosts = (import ./auxMonHosts.nix {});
|
||||
|
||||
in {
|
||||
|
||||
networking.hosts = {
|
||||
"fd00:23:23:23::1" = [ "monitoring-1.mon.entr0py.de" ];
|
||||
"fd00:23:23:23::1" = [ "kaon.mon.entr0py.de" ];
|
||||
}
|
||||
// monitoringHostsNames;
|
||||
|
||||
|
@ -62,16 +64,33 @@ in {
|
|||
}
|
||||
{
|
||||
job_name = "node-exporter";
|
||||
scrape_interval = "60s";
|
||||
scrape_interval = "20s";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"monitoring-1.mon.entr0py.de:9100"
|
||||
"kaon.mon.entr0py.de:9100"
|
||||
]
|
||||
++ monitoringTargets;
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "postgres";
|
||||
scrape_interval = "5s";
|
||||
static_configs = [
|
||||
{
|
||||
targets = auxHosts.postgresExporter;
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "synapse";
|
||||
scrape_interval = "5s";
|
||||
metrics_path = "/_synapse/metrics";
|
||||
static_configs = [{
|
||||
targets = auxHosts.synapseExporter;
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -86,6 +105,12 @@ in {
|
|||
}
|
||||
];
|
||||
};
|
||||
services.prometheus.exporters.postgres = {
|
||||
enable = true;
|
||||
runAsLocalSuperUser = true;
|
||||
port = 9101;
|
||||
};
|
||||
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
domain = "grafana.monitoring.entr0py.de";
|
||||
|
|
Loading…
Reference in a new issue