Skip to content

Instantly share code, notes, and snippets.

@bixu
Created January 28, 2016 17:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bixu/1d448892f1766a14f42c to your computer and use it in GitHub Desktop.
Save bixu/1d448892f1766a14f42c to your computer and use it in GitHub Desktop.
Send a key:value pair to a Circonus HTTPTrap endpoint
#!/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