From e7998f7bf847641c985b92788c1b5f5d792045d0 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 16 Apr 2024 23:58:37 +0200 Subject: [PATCH] take care of prometheus & node_exporter --- RUNTIME/DRAGON_p2p_ssh.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RUNTIME/DRAGON_p2p_ssh.sh b/RUNTIME/DRAGON_p2p_ssh.sh index ffb18473..b56eb0ac 100755 --- a/RUNTIME/DRAGON_p2p_ssh.sh +++ b/RUNTIME/DRAGON_p2p_ssh.sh @@ -123,6 +123,9 @@ if [[ -s ~/.zen/prometheus/prometheus ]]; then echo "UPDATING ~/.zen/prometheus/prometheus.yml" ## ADD ALL SWARM NODES TO MONITORING LIST for prometheus (GRAFANA) node + ncrunning=$(ps axf --sort=+utime | grep -w 'prometheus' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1) + [[ $ncrunning ]] && echo "RESTARTING" && kill -HUP $ncrunning + fi ncrunning=$(ps axf --sort=+utime | grep -w 'node_exporter' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)