mirror of
https://git.feal.no/felixalb/nixos-config.git
synced 2024-12-21 19:57:30 +01:00
metrics: parameterize
This commit is contained in:
parent
4edeb7be23
commit
fba827314b
@ -1,6 +1,7 @@
|
||||
{ config, pkgs, values, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
metricsHost = "192.168.10.175"; # defiant.home.feal.no
|
||||
in {
|
||||
services.prometheus.exporters.node = {
|
||||
enable = true;
|
||||
port = 9100;
|
||||
@ -11,7 +12,7 @@
|
||||
# TODO: Move this into the node-exporter systemd service
|
||||
allowedTCPPorts = [ 9100 ];
|
||||
extraCommands = ''
|
||||
iptables -A INPUT -p tcp -m tcp --source 192.168.10.175/32 --dport 9100 -j ACCEPT
|
||||
iptables -A INPUT -p tcp -m tcp --source ${metricsHost}/32 --dport 9100 -j ACCEPT
|
||||
iptables -A INPUT -p tcp -m tcp --dport 9100 -j DROP
|
||||
'';
|
||||
};
|
||||
@ -25,7 +26,7 @@
|
||||
};
|
||||
clients = [
|
||||
{
|
||||
url = "http://grafana.home.feal.no:3100/loki/api/v1/push";
|
||||
url = "http://${metricsHost}:3100/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
|
Loading…
Reference in New Issue
Block a user