sleuth basic ping health measure

#396
Raw
Author
Anonymous
Created
Oct. 13, 2021, 11:44 a.m.
Expires
Never
Size
419 bytes
Hits
34
Syntax
Bash
# Ping a website or webapp
# sent status code 0 (success) to sleuth if ping succeeds
# send status code 1 (fail) if fails

#will let us know something is off with this cron-script :)
code=666 

if ping -q -c 1 mysite.com>&1 > /dev/null ; then
    code=0
else
    code=1
fi

curl -X POST -d api_key=abcd12345 -d value=$code https://app.sleuth.io/api/1/impact/$myprojectid/register_impact