From 1eeccb54a2ca0a2451781c0d528a410dbffae3c2 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 19 Jul 2019 16:04:45 +0200 Subject: [PATCH] wolf.r: graphite.shack redirect to graphite:8080 --- krebs/1systems/wolf/config.nix | 8 ++++---- krebs/2configs/{ => shack}/graphite.nix | 20 +++++++++++++------- krebs/2configs/shack/influx.nix | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 11 deletions(-) rename krebs/2configs/{ => shack}/graphite.nix (87%) create mode 100644 krebs/2configs/shack/influx.nix diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index 3cb358ca3..3c3cf61fa 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -42,19 +42,19 @@ in # connect to git.shackspace.de as group runner for rz - # Statistics collection and visualization - + # Statistics collection and visualization + ## Collect data from mqtt.shack and store in graphite database ## Collect radioactive data and put into graphite ## mqtt.shack + ## influx.shack + ## Collect local statistics via collectd and send to collectd - { services.influxdb.enable = true; } - diff --git a/krebs/2configs/graphite.nix b/krebs/2configs/shack/graphite.nix similarity index 87% rename from krebs/2configs/graphite.nix rename to krebs/2configs/shack/graphite.nix index 64222e43a..1c8ec6a8b 100644 --- a/krebs/2configs/graphite.nix +++ b/krebs/2configs/shack/graphite.nix @@ -1,16 +1,22 @@ { config, lib, pkgs, ... }: +# hostname: graphite.shack + # graphite-web on port 8080 # carbon cache on port 2003 (tcp/udp) - -# TODO: krebs.graphite.minimal.enable -# TODO: configure firewall -with import ; -{ - imports = [ ]; - +let + port = 8080; +in { + networking.firewall.allowedTCPPorts = [ 2003 port ]; + networking.firewall.allowedUDPPorts = [ 2003 ]; + services.nginx.virtualHosts."graphite.shack" = { + locations."/" = { + proxyPass = "http://localhost:${toString port}/"; + }; + }; services.graphite = { api = { + inherit port; enable = true; listenAddress = "0.0.0.0"; }; diff --git a/krebs/2configs/shack/influx.nix b/krebs/2configs/shack/influx.nix new file mode 100644 index 000000000..599416c97 --- /dev/null +++ b/krebs/2configs/shack/influx.nix @@ -0,0 +1,18 @@ +let + port = 8086; +in +{ + networking.firewall.allowedTCPPorts = [ port ]; # for legacy applications + services.nginx.virtualHosts."influx.shack" = { + locations."/" = { + proxyPass = "http://localhost:${toString port}/"; + }; + }; + services.influxdb = { + enable = true; + extraConfig = { + bind-address = ":${toString port}"; + http.log-enabled = false; + }; + }; +}