Created
June 11, 2020 19:23
-
-
Save urjitbhatia/10c29d34d1a78488ae6fcd421bb0335b to your computer and use it in GitHub Desktop.
Examples of sending datadog events via commandline
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
# 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