Folks,
I am working on some system statistical gathering/plotting scripts
for our E5500 boxes and a couple linux boxes.
I am looking to gather some vmstat info from our linux boxes and
parse out certain data and do some calculations to get some data
to be plotted.
Here is what I have so far (rough stab, very early stages)
#!/usr/bin/perl -w
use Getopt::Long;
use Time::Local;
use strict;
my $x;
my @output;
$| = 1;
@output = qx(vmstat 5 2 );
shift @output;
shift @output;
print "Total lines: " . @output . "\n";
# 1 0 0 1896 3836 28936 83252 0 0 3 16 9 3 5 24
20
# 1 0 0 1896 3836 28936 83252 0 0 3 16 9 3 5 24
20
for (@output) {
chomp $_;
my ($IOBO) = unpack "A2", $_;
print $IOBO;
}
I started right I hope ;) -w, strict etc..
my problem is this, I am taking 2 snaps of vmstat and putting them into
@output,
I need to parse @output and pull columns 11,13,14 and 16 out of the vmstat
data.
I initially thought of using unpack, but for some odd reason I could never
get it right
with exception to unpack A* ;)
Could someone lend a guiding hand on this minor parse issue?
Regards,
Ron