Telegraf agent determine if host is down, output to datadog

What is the best way to tell if a ubuntu device is down, so i can send the information to datadog?