Skip to content

Instantly share code, notes, and snippets.

@urjitbhatia
Created June 11, 2020 19:23
Show Gist options
  • Save urjitbhatia/10c29d34d1a78488ae6fcd421bb0335b to your computer and use it in GitHub Desktop.
Save urjitbhatia/10c29d34d1a78488ae6fcd421bb0335b to your computer and use it in GitHub Desktop.
Examples of sending datadog events via commandline
# https://help.datadoghq.com/hc/en-us/articles/206441345-Send-metrics-and-events-using-dogstatsd-and-the-shell
# Send an event to DD based on success or failure
echo "_e{${#title},${#text}}:$title|$text|t:${alert_type}" | nc -u -w1 "${HOST_IP}" 8125
if [ "$CMD_EXIT_CODE" -eq 0 ];
echo "foo.bar.success:1|g" | nc -u -w1 "${HOST_IP}" 8125
then
echo "foo.bar.failure:1|g" | nc -u -w1 "${HOST_IP}" 8125
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment