Created
September 17, 2013 21:56
-
-
Save scr512/6601232 to your computer and use it in GitHub Desktop.
Send Isilon disk usage and cluster status from node to Dashing dashboard via ghetto BASH JSON PUT.
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/zsh | |
hdd=$(isi status | grep 'Used:' | awk '{print$3}' | tr -d '()%') | |
clu_health=$(isi statistics query -nall --stats=cluster.health | grep average | awk '{print$2}') | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "mysecrettokenring", "value": "'"$hdd"'" }' --header=Content-Type:application/json "http://10.112.88.114:3030/widgets/aus-hdd" | |
if [ $clu_health -eq 0 ] | |
then | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "mysecrettokenring", "text": "Healthy", "background-color": "#12DE4F" }' --header=Content-Type:application/json "http://10.112.88.114:3030/widgets/aus-health" | |
else | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "mysecrettokenring", "text": "Attention", "background-color": "#DE4C12" }' --header=Content-Type:application/json "http://10.112.88.114:3030/widgets/aus-health" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment