[OmniOS-discuss] iostat skip first output

Rune Tipsmark rt at steait.net
Sat Jan 24 19:42:14 UTC 2015


nevermind, I just made it into tokens and counted my way though it... maybe not the best way but it works...



root at zfs10:/usr/lib/check_mk_agent/local<mailto:root at zfs10:/usr/lib/check_mk_agent/local># cat disk_iostat.sh
varInterval=5
varOutput=$(iostat -xn $varInterval 2 | grep c[0-99]);
tokens=( $varOutput )
tokenCount=$(echo ${tokens[*]} | wc -w )
tokenStart=$(((tokenCount/2)-1))
tokenInterval=11
tokenEnd=$((tokenCount))
for i in $(eval echo {$tokenStart..$tokenEnd..$tokenInterval});
 do echo 0 disk_busy_${tokens[$i]} percent=${tokens[$i-1]} ${tokens[$i-1]} % average disk utilization last $varInterval seconds;
    echo 0 disk_latency_${tokens[$i]} ms=${tokens[$i-3]} ${tokens[$i-3]} ms response time average last $varInterval seconds;
done

________________________________
From: OmniOS-discuss <omnios-discuss-bounces at lists.omniti.com> on behalf of Rune Tipsmark <rt at steait.net>
Sent: Saturday, January 24, 2015 6:25 PM
To: omnios-discuss at lists.omniti.com
Subject: [OmniOS-discuss] iostat skip first output


hi all, I am just writing some scripts to gather performance data from iostat... or at least trying... I would like to completely skip the first output since boot from iostat output and just get right to the period I specified with the data current from that period. Is this possible at all?



br,

Rune
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20150124/e0d9ddd1/attachment.html>


More information about the OmniOS-discuss mailing list