some reason in my head this doesn't seem terribly difficult but again
i'm not a programmer.
it would seem that right around line 403 of the io script is where the
logic might be or should be which will exclude the first bit of data.
# The get data from iostat
# This doesn't include tps
#$cmd = 'iostat -x ALL 5 2';
# So use this hilarious hack to get all the data for the same 5
seconds:
$cmd = "(iostat -x ALL 5 2 2>&1 | sed 's/^/ALL /') & (iostat 5 2
2>&1 | sed 's/^/TPS /') &";
($status, @data) = run_prg ($cmd, $g_default_timeout);
if ( $status != 0 ) {
fileit ("Bad status for $cmd: $status. Output was: @data\n");
return (undef);
}
foreach $hack qw(ALL TPS) {
$saw_device = 0;
LOOP: foreach $line (@data) {
undef (%s);
chomp ($line);
if ( $line !~ /^$hack / || $line =~ /^$hack $/ ) {
next LOOP;
}
if ( $line =~ /^$hack Device:/ ) {
$saw_device++;
if ( $line =~ /rkB\/s wkB\/s/ ) {
$splice = 1;
} else {
$splice = 0;
}
next LOOP;
}
if ( $saw_device == 2 ) {
$line =~ s/^\w+ //;
if ( $hack eq 'ALL' ) {
if ( $splice ) {
@t = splice (@{[(split (/\s+/, $line))]}, 7, 2);
} else {
@t = split (/\s+/, $line);
}
($dev, $s{'rrqm'}, $s{'wrqm'}, $s{'readreq'},
$s{'writereq'}, $s{'read'},
$s{'write'}, $s{'avgrq_sz'}, $s{'avgqu_sz'}, $s{'avwait'},
$s{'svctm'},
$s{'util'}) = @t;
} else {
($dev, $s{'tps'}) = (split (/\s+/, $line))[0, 1];
}
essentially what you would want to do is read in the values to store
an array maybe something like:
index,data1,data2,data3,etc....
device,0,0,0,0,etc...
once you've built the array, simply overwrite the data in the array
with the 2nd set of data. that could very well be what it's doing, i'm
just not experienced enough to know.
On Jun 24, 1:23 pm, Scott Parish <
srpar...@gmail.com> wrote:
> I ended up writing my own collector. I have a long lived python script
> that popen()s sar, telling it to report every 60 seconds, and then
> parses and pushes the results (every 60s) back into yacketystats. The
> downside is if/when it crashes it has to be restarted by something (eg
> monit or similar) or you just don't have any stats until someone
> notices and restarts it.
>
> If anyone's interested i could clean it up and send it out for other
> people to use. Probably only works on linux at the moment.
>
> sRp
>
> On Thu, Jun 24, 2010 at 1:03 PM, Sam Rowe <
sam.r...@gmail.com> wrote:
> > If you guys would like to suggest an alternate method for collecting
> > the stats, I'm guessing that would skip one round of Happy asking what
> > you'd like it to be :)
>
> > On Thu, Jun 24, 2010 at 1:08 PM, Scott Parish <
srpar...@gmail.com> wrote:
> >> For what its worth, i think the sar script has a similar problem--it
> >> samples data from 3 seconds out of each minute, rather then sampling
> >> for the whole minute
>
> >> sRp
>