-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from m-lab/sandbox-kinkade
Adds script to deploy blackbox_exporter config to Linode VM, adds IPv6 BBE modules
- Loading branch information
Showing
5 changed files
with
156 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# | ||
# Deploys the blackbox_exporter config to an external (e.g., Linode) VM which | ||
# will perform IPv6 probes, since GCP doesn't currently support IPv6. | ||
# | ||
# Example usage: | ||
# ./deploy_bbe_config.sh mlab-sandbox LINODE_PRIVATE_KEY_ipv6_monitoring | ||
|
||
set -e | ||
set -u | ||
set -x | ||
|
||
BASE_DIR=$( dirname ${BASH_SOURCE[0]} ) | ||
USAGE="Usage: $0 <project> <keyname>" | ||
PROJECT=${1:?Please provide project name: $USAGE} | ||
KEYNAME=${2:?Please provide an authentication key name: $USAGE} | ||
BBE_CONFIG="${BASE_DIR}/config/federation/blackbox/config.yml" | ||
LINODE_DOMAIN="blackbox-exporter-ipv6.${PROJECT}.measurementlab.net" | ||
LINODE_USER="mlab" | ||
LOCAL_KEY_FILE="id_rsa_linode" | ||
SSH_OPTS="-i $LOCAL_KEY_FILE -o IdentitiesOnly=yes -o StrictHostKeyChecking=no" | ||
|
||
# Extract the SSH key from the configured Travis environment variable. The key | ||
# is base64 encoded to avoid the need for shell escaping and newlines. Set the | ||
# mode of the file appropriately, as SSH will refuse to use it if the | ||
# permissions are not strict enough. | ||
echo "${!KEYNAME}" | base64 -d > $LOCAL_KEY_FILE | ||
chmod 600 $LOCAL_KEY_FILE | ||
|
||
# Copy blackbox_exporter config file to the Linode VM. | ||
scp $SSH_OPTS $BBE_CONFIG $LINODE_USER@$LINODE_DOMAIN:blackbox-exporter-config-$PROJECT.yml | ||
|
||
# HUP the blackbox_exporter so it reads the new config. | ||
ssh $SSH_OPTS $LINODE_USER@$LINODE_DOMAIN "docker exec ${PROJECT} kill -HUP 1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters