Created
February 20, 2025 14:02
-
-
Save nickkostov/13faa0ea59c62b80dee3e9d5f65972d6 to your computer and use it in GitHub Desktop.
A little Helper with the DataDog Agent
This file contains hidden or 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
#!/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