Comment 5 for bug 1982537

Revision history for this message
Yoshi Kadokawa (yoshikadokawa) wrote :

There is a upstream bug report for this.
https://tracker.ceph.com/issues/53505

Maybe not a smart workaround but by adding a new datasource with the name "Dashboard1" will work as well. I believe with this workaround it will still remain even after charm update or package update.

GRAFANA_IP=$(juju run -m lma-maas --unit grafana/leader \
  "network-get --bind-address website")
PROMETHEUS_IP=$(juju run -m lma-maas --unit prometheus/leader \
  "network-get --bind-address website")
juju run-action -m lma-maas --wait grafana/leader get-login-info --format json | tee grafana-login-info
user="$(cat grafana-login-info | jq -r .[].results.username)"
pass="$(cat grafana-login-info | jq -r .[].results.password)"
auth_base64="$(echo -n ${user}:${pass} | openssl base64)"

curl -k -X POST \
  https://"$GRAFANA_IP":3000/api/datasources \
  -H 'Accept: application/json' \
  -H 'Content-Type:application/json' \
  -H "Authorization: Basic ${auth_base64}" \
  -d @- << EOS
{"name":"Dashboard1","type":"prometheus","url":"http://${PROMETHEUS_IP}:9090","access":"proxy","basicAuth":false}
EOS