From: Michael Fritch Date: Fri, 31 Jan 2020 15:22:01 +0000 (-0700) Subject: qa/workunits/cephadm/test_cephadm.sh: add missing monitoring tests X-Git-Tag: v15.1.1~565^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32977%2Fhead;p=ceph.git qa/workunits/cephadm/test_cephadm.sh: add missing monitoring tests add tests for node-exporter, prometheus, and grafana Signed-off-by: Michael Fritch --- diff --git a/qa/workunits/cephadm/test_cephadm.sh b/qa/workunits/cephadm/test_cephadm.sh index ba1af1340613f..973d2c18a166e 100755 --- a/qa/workunits/cephadm/test_cephadm.sh +++ b/qa/workunits/cephadm/test_cephadm.sh @@ -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 diff --git a/src/cephadm/samples/grafana.json b/src/cephadm/samples/grafana.json index 36f6e43b6adbd..bda4887cdbfee 100644 --- a/src/cephadm/samples/grafana.json +++ b/src/cephadm/samples/grafana.json @@ -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 +}