From 01af77e01f69c2f86bd17910b3c40e84deee2a8f Mon Sep 17 00:00:00 2001 From: oliver Date: Sun, 6 Oct 2024 01:54:18 +0000 Subject: [PATCH] updates from the day --- compose-server.yml | 8 ++++++++ deploy-node.sh | 3 +++ reload-prom.sh | 4 ++++ 3 files changed, 15 insertions(+) create mode 100755 deploy-node.sh create mode 100755 reload-prom.sh diff --git a/compose-server.yml b/compose-server.yml index 8d2a960..8059387 100644 --- a/compose-server.yml +++ b/compose-server.yml @@ -18,14 +18,18 @@ services: - 9090 volumes: - ./prometheus.yaml:/etc/prometheus/prometheus.yml + # persist data + - prometheus_storage:/prometheus depends_on: - caddy + command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml # log viewer grafana: image: grafana/grafana:latest volumes: - ./grafana.yaml:/etc/grafana/provisioning/datasources/datasources.yaml + - grafana_storage:/var/lib/grafana environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin @@ -33,3 +37,7 @@ services: - GF_FEATURE_TOGGLES_ENABLE=traceqlEditor depends_on: - prometheus + +volumes: + prometheus_storage: + grafana_storage: diff --git a/deploy-node.sh b/deploy-node.sh new file mode 100755 index 0000000..979b864 --- /dev/null +++ b/deploy-node.sh @@ -0,0 +1,3 @@ +wget https://git.oliveratkinson.net/Oliver/linux-node-visability/raw/branch/master/compose-node.yml +sudo ufw allow from 10.50.50.0/24 to any port 9100 +docker compose -f compose-node.yml up -d diff --git a/reload-prom.sh b/reload-prom.sh new file mode 100755 index 0000000..3f1acab --- /dev/null +++ b/reload-prom.sh @@ -0,0 +1,4 @@ +IP=$(sudo docker ps | grep prometheus | grep -v node | awk '{print $1}' | xargs -I{} sudo docker inspect {} | grep IPAddress | tail -n 1 | awk '{print $2}' | sed -n '1 s/"//gp' | sed -n '1 s/,//gp') + +echo $IP +curl -X POST http://$IP:9090/-/reload