Skip to content

Instantly share code, notes, and snippets.

@nickkostov
Created February 20, 2025 14:02
Show Gist options
  • Save nickkostov/13faa0ea59c62b80dee3e9d5f65972d6 to your computer and use it in GitHub Desktop.
Save nickkostov/13faa0ea59c62b80dee3e9d5f65972d6 to your computer and use it in GitHub Desktop.
A little Helper with the DataDog Agent
#!/bin/bash
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"
}
log "###################################### Displaying the last 200 lines of the Datadog agent log: ######################################"
tail -200 /var/log/datadog/agent.log
log "###################################### Displaying the first 200 lines of the Datadog agent log: ######################################"
head -200 /var/log/datadog/agent.log
# Check Datadog agent status
log "###################################### Checking Datadog agent status: ######################################"
sudo datadog-agent status
# Check Datadog agent health
log "###################################### Checking Datadog agent health:######################################"
sudo datadog-agent health
log "###################################### Checking Datadog agent hostname: ######################################"
sudo datadog-agent hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment