Custom Shell Check for Datadog Agents

One of the greatest things I’ve found about Datadog agent is it’s extensible nature.  While there are numerous OOB integrations, we often find an edge case or two that require some quick code and a custom check here and there.

This is one that had previously been put up in one of the repos but I found that as the agent had updated, this check to run shell commands and retrieve metrics relied on some code that was included with the agent that changed over some revisions. So… I re-wrote this to operate as a standalone.

This check allows you to run shell commands, retrieve a numeric value from them, and publish them to your Datadog account with the metric names  shell.your_metric_name at the regular agent check interval.

You can find all of this code at the link above or just go to https://github.com/themsquared/datadog-checks/tree/master/shell and check it out!  You can find out more about the Datadog Agent and where these config and check files go by checking out the docs here:  https://docs.datadoghq.com/agent/

Questions? Feel free to post them below or hit me up on any of my social media channels!

Mike Moore

Hi! My name is Mike Moore and you're on the Web Of Mike. Here you'll find general brainings and ramblings on technology, APIs, coding, beer, and whatever else I feel like talking about at the moment. Enjoy and stop by often for new content!

You may also like...