1 | 1 | simandl | package HotSaNICmod::OSdep; |
2 | | | |
3 | | | sub version { |
4 | | | ($VERSION = '$Revision: 1.6 $') =~ s/.*(\d+\.\d+).*/$1/; |
5 | | | return "$^O.pm $VERSION"; |
6 | | | } |
7 | | | |
8 | | | sub sample { |
9 | | | my (@drives,@iodat, $drive,$KBt,$xfr,$time,$MBs); |
10 | | | open IOSTAT, "/usr/sbin/iostat -Id |" |
11 | | | or die time."diskio: $!"; |
12 | | | @data = <IOSTAT>; |
13 | | | close IOSTAT; |
14 | | | @drives = split / +/, $data[0]; |
15 | | | @iodat = split / +/, $data[2]; |
16 | | | shift @drives; shift @iodat; |
17 | | | foreach $drive (@drives) { |
18 | | | chomp $drive; |
19 | | | last if ($drive eq ""); |
20 | | | $KBt = shift @iodat; |
21 | | | $xfr = shift @iodat; |
22 | | | $time= 0; |
23 | | | $MB = shift @iodat; |
24 | | | HotSaNICmod::do_rrd($drive,"U",time,$KBt*1024,$xfr,$time,$MB*1024*1024); |
25 | | | } |
26 | | | } |
27 | | | |
28 | | | 1; |