Created
January 8, 2013 13:20
-
-
Save kashyapp/4483766 to your computer and use it in GitHub Desktop.
Stupid script to read from sysstat and send to carbon
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 | |
set -e | |
#set -x | |
SEND="nc -v -v -q2 w3-api3 2003" | |
#SEND=cat | |
SED="sed s/[%/]//gI" | |
SADF="sadf -s $1 /var/log/sysstat/$2 --" | |
$SADF -d | grep 'dev254-[278]' | $SED | awk '{print "sys.hostmetrics." $1 ".deviceio." $4 "." $5 ".per_min", $6, $3}' | $SEND | |
$SADF -S | fgrep kbswp | $SED | awk '{print "sys.hostmetrics." $1 ".deviceio." $5 ".per_min", $6, $3}' | $SEND | |
$SADF -r | grep '\<kb' | $SED | awk '{print "sys.hostmetrics." $1 ".deviceio." $5 ".per_min", $6, $3}' | $SEND | |
$SADF -W | $SED | awk '{print "sys.hostmetrics." $1 ".deviceio." $5 ".per_min", $6, $3}' | $SEND | |
$SADF -b | $SED | awk '{print "sys.hostmetrics." $1 ".deviceio." $5 ".per_min", $6, $3}' | $SEND | |
$SADF -q | fgrep ldavg-5| $SED | awk '{print "sys.hostmetrics." $1 ".load." $5 ".per_min", $6, $3}' | $SEND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment