Created
September 3, 2012 15:46
-
-
Save 1stvamp/3610175 to your computer and use it in GitHub Desktop.
Post custom metric data for a device to the Server Density API
This file contains 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 | |
# Use i-node usage for disk usage stats | |
stat=$(df -i | grep -F /dev/disk1) | |
av=$(echo $stat | awk '{print $4}') | |
ius=$(echo $stat | awk '{print $6}') | |
us=$(echo $stat | awk '{print $8}' | sed -e 's/.$//') | |
cp=$(echo $stat | awk '{print $5}') | |
mt=$(echo $stat | awk '{print $9}') | |
payload=" | |
{ | |
\"agentKey\" : \"6d6ed3d1150ba02f1aa30c43\", | |
\"diskUsage\": [ | |
[\"/dev/disk1\", \"$ius\", \"$us\", \"$av\", \"$cp\", \"$mt\"] | |
] | |
}" | |
echo $payload | densli metrics.postback deviceId=4cb4ab6d7addf98506010000 --postback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment