gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-grid5k] 62/73: fix monitor


From: gnunet
Subject: [taler-grid5k] 62/73: fix monitor
Date: Tue, 14 Dec 2021 15:10:44 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository grid5k.

commit c802de8b862b83932d83e8b42ee1f3f4b38d7a15
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Fri Dec 10 21:04:23 2021 +0100

    fix monitor
---
 .../nginx/{sites-available => sites-enabled}/proxy |  0
 experiment/scripts/database.sh                     |  4 ++--
 experiment/scripts/monitor.sh                      | 25 ++++++++++++++++++----
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/configs/etc/nginx/sites-available/proxy 
b/configs/etc/nginx/sites-enabled/proxy
similarity index 100%
rename from configs/etc/nginx/sites-available/proxy
rename to configs/etc/nginx/sites-enabled/proxy
diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index 923498d..706a0a7 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -128,8 +128,8 @@ psql -tAc "SELECT 1 FROM pg_database WHERE 
datname='${DB_NAME}'" | \
   createdb -O taler-exchange-httpd "${DB_NAME}"
 EOF
   
-  sudo -u taler-exchange-httpd taler-exchange-dbinit -r || true
-  sudo -u taler-exchange-httpd taler-exchange-dbinit -s || true
+#  sudo -u taler-exchange-httpd taler-exchange-dbinit -r || true
+#  sudo -u taler-exchange-httpd taler-exchange-dbinit -s || true
   sudo -u taler-exchange-httpd taler-exchange-dbinit
   
   su postgres << EOF
diff --git a/experiment/scripts/monitor.sh b/experiment/scripts/monitor.sh
index ddbce61..0e824a0 100755
--- a/experiment/scripts/monitor.sh
+++ b/experiment/scripts/monitor.sh
@@ -59,6 +59,19 @@ function add_wallet_nodes_to_prometheus() {
 }
 
 function add_exchanges_to_prometheus() {
+  if ! grep -q "${EXCHANGE_DOMAIN}:80" /etc/monitor/prometheus.yaml; then
+    # unfortunately we do not have access to the other hosts when running from 
ESpec
+    # But when initializing there are no hosts listed in the yaml yet, thus
+    # it's sufficient to search for the exchange from the target
+    sed -i "/<EXCHANGES_HERE>/a  \ \ \ \ \ \ - '${EXCHANGE_DOMAIN}:80'" \
+            /etc/monitor/prometheus.yaml
+    for i in $(seq $((${NUM_EXCHANGE_PROCESSES:-10}-1)) ); do
+      let "i+=10000"
+      sed -i "/<EXCHANGES_HERE>/a  \ \ \ \ \ \ - '${EXCHANGE_DOMAIN}:${i}'" \
+              /etc/monitor/prometheus.yaml
+    done
+    return
+  fi
   for EXCH in $(get_exchanges); do 
     if ! grep -q "${EXCH}" /etc/monitor/prometheus.yaml;
     then
@@ -97,12 +110,16 @@ function init_monitor() {
   wait_for_keys "${PROXY_DOMAIN}"
   
   if [[ "${ENABLE_EXPORTERS}" == "true" ]]; then
-    cat /etc/monitor/node-exporters.yaml.tpl | envsubst >> 
/etc/monitor/prometheus.yaml
-    add_wallet_nodes_to_prometheus
+    if ! grep -q "job_name: 'nodes'" /etc/monitor/prometheus.yaml; then 
+      cat /etc/monitor/node-exporters.yaml.tpl | envsubst >> 
/etc/monitor/prometheus.yaml
+      add_wallet_nodes_to_prometheus
+    fi
   fi
 
-  cat /etc/monitor/exchange-exporters.yaml.tpl >> /etc/monitor/prometheus.yaml
-  add_exchanges_to_prometheus
+  if ! grep -q "job_name: 'taler'" /etc/monitor/prometheus.yaml; then
+    cat /etc/monitor/exchange-exporters.yaml.tpl >> 
/etc/monitor/prometheus.yaml
+    add_exchanges_to_prometheus
+  fi
 
   systemctl restart prometheus-nginx-exporter \
                     prometheus-postgres-exporter \

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]