jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [diskio/] [platform/] [freebsd.pm] - Rev 15 Go to most recent revision

Compare with Previous - Blame - Download


package HotSaNICmod::OSdep;

sub version {
  ($VERSION = '$Revision: 1.6 $') =~ s/.*(\d+\.\d+).*/$1/;
  return "$^O.pm $VERSION";
  }

sub sample {
  my (@drives,@iodat, $drive,$KBt,$xfr,$time,$MBs);
  open IOSTAT, "/usr/sbin/iostat -Id |"
    or die time."diskio: $!";
  @data = <IOSTAT>;
  close IOSTAT;
  @drives = split / +/, $data[0];
  @iodat  = split / +/, $data[2];
  shift @drives; shift @iodat;
  foreach $drive (@drives) {
    chomp $drive;
    last if ($drive eq "");
    $KBt = shift @iodat;
    $xfr = shift @iodat;
    $time= 0;
    $MB  = shift @iodat;
    HotSaNICmod::do_rrd($drive,"U",time,$KBt*1024,$xfr,$time,$MB*1024*1024);
    }
  }

1;

Powered by WebSVN 2.2.1