install-prometheus-server.sh 662 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. set -x
  3. set -e
  4. TOOLS_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
  5. pushd "$TOOLS_DIR"
  6. # Download Prometheus server.
  7. unamestr="$(uname)"
  8. if [[ "$unamestr" == "Linux" ]]; then
  9. echo "Downloading Prometheus server for linux system."
  10. PACKAGE_NAME=prometheus-2.8.0.linux-amd64
  11. elif [[ "$unamestr" == "Darwin" ]]; then
  12. echo "Downloading Prometheus server for MacOS system."
  13. PACKAGE_NAME=prometheus-2.8.0.darwin-amd64
  14. else
  15. echo "Downloading abort: Unrecognized platform."
  16. exit 1
  17. fi
  18. URL=https://github.com/prometheus/prometheus/releases/download/v2.8.0/$PACKAGE_NAME.tar.gz
  19. wget $URL
  20. tar xvfz $PACKAGE_NAME.tar.gz
  21. popd