tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
prometheus exporter modules: unify firewall handling
Robin Gloster
9 years ago
575afe3f
618b249f
+49
-1
5 changed files
expand all
collapse all
unified
split
nixos
modules
services
monitoring
prometheus
blackbox-exporter.nix
json-exporter.nix
nginx-exporter.nix
node-exporter.nix
varnish-exporter.nix
+10
nixos/modules/services/monitoring/prometheus/blackbox-exporter.nix
···
31
31
Extra commandline options when launching the blackbox exporter.
32
32
'';
33
33
};
34
34
+
35
35
+
openFirewall = mkOption {
36
36
+
type = types.bool;
37
37
+
default = false;
38
38
+
description = ''
39
39
+
Open port in firewall for incoming connections.
40
40
+
'';
41
41
+
};
34
42
};
35
43
};
36
44
37
45
config = mkIf cfg.enable {
46
46
+
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port;
47
47
+
38
48
systemd.services.prometheus-blackbox-exporter = {
39
49
description = "Prometheus exporter for blackbox probes";
40
50
unitConfig.Documentation = "https://github.com/prometheus/blackbox_exporter";
+10
nixos/modules/services/monitoring/prometheus/json-exporter.nix
···
38
38
Extra commandline options when launching the JSON exporter.
39
39
'';
40
40
};
41
41
+
42
42
+
openFirewall = mkOption {
43
43
+
type = types.bool;
44
44
+
default = false;
45
45
+
description = ''
46
46
+
Open port in firewall for incoming connections.
47
47
+
'';
48
48
+
};
41
49
};
42
50
};
43
51
44
52
config = mkIf cfg.enable {
53
53
+
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port;
54
54
+
45
55
systemd.services.prometheus-json-exporter = {
46
56
description = "Prometheus exporter for JSON over HTTP";
47
57
unitConfig.Documentation = "https://github.com/kawamuray/prometheus-json-exporter";
+9
-1
nixos/modules/services/monitoring/prometheus/nginx-exporter.nix
···
41
41
Extra commandline options when launching the nginx exporter.
42
42
'';
43
43
};
44
44
+
45
45
+
openFirewall = mkOption {
46
46
+
type = types.bool;
47
47
+
default = false;
48
48
+
description = ''
49
49
+
Open port in firewall for incoming connections.
50
50
+
'';
51
51
+
};
44
52
};
45
53
};
46
54
47
55
config = mkIf cfg.enable {
48
48
-
networking.firewall.allowedTCPPorts = [ cfg.port ];
56
56
+
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port;
49
57
50
58
systemd.services.prometheus-nginx-exporter = {
51
59
after = [ "network.target" "nginx.service" ];
+10
nixos/modules/services/monitoring/prometheus/node-exporter.nix
···
44
44
Extra commandline options when launching the node exporter.
45
45
'';
46
46
};
47
47
+
48
48
+
openFirewall = mkOption {
49
49
+
type = types.bool;
50
50
+
default = false;
51
51
+
description = ''
52
52
+
Open port in firewall for incoming connections.
53
53
+
'';
54
54
+
};
47
55
};
48
56
};
49
57
50
58
config = mkIf cfg.enable {
59
59
+
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port;
60
60
+
51
61
systemd.services.prometheus-node-exporter = {
52
62
description = "Prometheus exporter for machine metrics";
53
63
unitConfig.Documentation = "https://github.com/prometheus/node_exporter";
+10
nixos/modules/services/monitoring/prometheus/varnish-exporter.nix
···
25
25
Extra commandline options when launching the Varnish exporter.
26
26
'';
27
27
};
28
28
+
29
29
+
openFirewall = mkOption {
30
30
+
type = types.bool;
31
31
+
default = false;
32
32
+
description = ''
33
33
+
Open port in firewall for incoming connections.
34
34
+
'';
35
35
+
};
28
36
};
29
37
};
30
38
31
39
config = mkIf cfg.enable {
40
40
+
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port;
41
41
+
32
42
systemd.services.prometheus-varnish-exporter = {
33
43
description = "Prometheus exporter for Varnish metrics";
34
44
unitConfig.Documentation = "https://github.com/jonnenauha/prometheus_varnish_exporter";