]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephadm/test_cephadm.sh: add missing monitoring tests 32977/head
authorMichael Fritch <mfritch@suse.com>
Fri, 31 Jan 2020 15:22:01 +0000 (08:22 -0700)
committerMichael Fritch <mfritch@suse.com>
Mon, 3 Feb 2020 04:08:02 +0000 (21:08 -0700)
add tests for node-exporter, prometheus, and grafana

Signed-off-by: Michael Fritch <mfritch@suse.com>
qa/workunits/cephadm/test_cephadm.sh
src/cephadm/samples/grafana.json

index ba1af1340613f6502bc0de7fedabcee2278108e1..973d2c18a166ebed430764c1bb1c2658507e6a15 100755 (executable)
@@ -24,10 +24,13 @@ OSD_TO_CREATE=6
 OSD_VG_NAME=${SCRIPT_NAME%.*}
 OSD_LV_NAME=${SCRIPT_NAME%.*}
 
+CEPHADM_SRC_DIR=${SCRIPT_DIR}/../../../src/cephadm
+CEPHADM_SAMPLES_DIR=${CEPHADM_SRC_DIR}/samples
+
 [ -z "$SUDO" ] && SUDO=sudo
 
 if [ -z "$CEPHADM" ]; then
-    CEPHADM=${SCRIPT_DIR}/../../../src/cephadm/cephadm
+    CEPHADM=${CEPHADM_SRC_DIR}/cephadm
 fi
 
 # at this point, we need $CEPHADM set
@@ -204,6 +207,31 @@ for id in `seq 0 $((--OSD_TO_CREATE))`; do
                 $(hostname):/dev/$OSD_VG_NAME/$OSD_LV_NAME.$id
 done
 
+# add node-exporter
+$CEPHADM --image 'prom/node-exporter:latest' \
+    deploy --name node-exporter.a --fsid $FSID
+sleep 90
+out=$(curl 'http://localhost:9100')
+echo $out | grep -q 'Node Exporter'
+
+# add prometheus
+cat ${CEPHADM_SAMPLES_DIR}/prometheus.json | \
+        $CEPHADM --image 'prom/prometheus:latest' \
+            deploy --name prometheus.a --fsid $FSID \
+                   --config-json -
+sleep 90
+out=$(curl 'localhost:9095/api/v1/query?query=up')
+echo $out | jq -e '.["status"] == "success"'
+
+# add grafana
+cat ${CEPHADM_SAMPLES_DIR}/grafana.json | \
+        $CEPHADM --image 'pcuzner/ceph-grafana-el8:latest' \
+            deploy --name grafana.a --fsid $FSID \
+                   --config-json -
+sleep 90
+out=$(curl --insecure option 'https://localhost:3000')
+echo $out | grep -q 'grafana'
+
 ## run
 # WRITE ME
 
index 36f6e43b6adbdc3cb5b6570434afa72583a46009..bda4887cdbfee27336da132cfe3cfd1350ae8a53 100644 (file)
@@ -12,7 +12,7 @@
             "  cert_file = /etc/grafana/certs/cert_file",
             "  cert_key = /etc/grafana/certs/cert_key",
             "  http_port = 3000",
-            "  http_addr = 10.90.90.150",
+            "  http_addr = localhost",
             "[security]",
             "  admin_user = admin",
             "  admin_password = admin",
@@ -28,7 +28,7 @@
             "    type: 'prometheus'",
             "    access: 'proxy'",
             "    orgId: 1",
-            "    url: 'http://10.90.90.150:9095'",
+            "    url: 'http://localhost:9095'",
             "    basicAuth: false",
             "    isDefault: true",
             "    editable: false"
@@ -85,4 +85,4 @@
         "mEl75h1ToBX9yvnH39o50g==",
         "-----END PRIVATE KEY-----"
     ]
-}
\ No newline at end of file
+}