jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [diskio/] [platform/] [netbsd.pm] - Blame information for rev 31

 

Line No. Rev Author Line
131simandlpackage HotSaNICmod::OSdep;
2 
3use RRDs;
4 
5sub version {
6 ($VERSION = '$Revision: 1.3 $') =~ s/.*(\d+\.\d+).*/$1/;
7 return "$^O.pm $VERSION";
8 }
9 
10sub sample {
11 my ($drive,$KBt,$xfr,$time,$MBs);
12 open IOSTAT, "/usr/sbin/iostat -Ix |"
13 or die time."diskio: $!";
14 while (<IOSTAT>) {
15 chomp;
16 ($drive,$KBt,$xfr,$time,$MB) = split / +/, $_;
17 next if ($drive =~ /device/);
18 #print localtime(time)." diskio: $drive, $KBt, $xfr, $time, $MB\n";
19 
20 if ( ! -e "rrd/$drive.rrd" ) { system("./makerrd","$drive","U") }
21 RRDs::update "rrd/$drive.rrd",time.":".($KBt*1024).":$xfr:$time:".($MB*1024*1024);
22 if ($ERROR = RRDs::error) { print time," ",$args{MODNAME},": unable to update `$drive.rrd': $ERROR\n"; }
23 }
24 close IOSTAT;
25 }
26 
271;
28 

Powered by WebSVN 2.2.1