take care of prometheus & node_exporter

This commit is contained in:
fred 2024-04-16 23:58:37 +02:00
parent 54d4837fd6
commit e7998f7bf8
1 changed files with 3 additions and 0 deletions

View File

@ -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)