Created
January 28, 2016 17:07
-
-
Save bixu/1d448892f1766a14f42c to your computer and use it in GitHub Desktop.
Send a key:value pair to a Circonus HTTPTrap endpoint
This file contains hidden or 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
#!/bin/bash | |
# Note that the -k flag here means we are ignoring cert warnings. | |
# If security matters you should use the Circonus cert provided | |
# here: http://login.circonus.com/pki/ca.crt | |
KEY=$1 | |
VALUE=$2 | |
ENDPOINT_URL=$3 | |
metric_json() | |
{ | |
echo "{ \"$KEY\": $VALUE }" | |
} | |
curl -H 'Content-Type: application/json' -k -X PUT -d "$(metric_json)" $ENDPOINT_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment