executable_mjru-grafana 599 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. set -o nounset -o errexit -o pipefail -o xtrace
  3. GRAFANA_USERNAME="${USERNAME:-sup}"
  4. GRAFANA_PASSWORD="${PASSWORD:-$(pass show majordomo/public/grafana.intr/sup)}"
  5. GRAFANA_HOSTNAME="${GRAFANA_HOSTNAME:-grafana.intr}"
  6. GRAFANA_API="${GRAFANA_API:-https://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}}"
  7. case "$1" in
  8. search)
  9. curl --silent "${GRAFANA_API}/api/search"
  10. ;;
  11. render)
  12. curl --verbose --verbose "${GRAFANA_API}/render/ogvzsY3mb/web-performance-panelized?orgId=1&refresh=30s&viewPanel=6&width=1000&height=500"
  13. ;;
  14. esac