###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2008 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
$querry[0] = '' unless defined $querry[0];
$querry[1] = 'hour' unless defined $querry[1];
-my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
+my @devices = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^xvd|^vd|^md' | sort | uniq`;
-if ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??"){
+if ( $querry[0] =~ "sd?" || $querry[0] =~ "mmcblk?" || $querry[0] =~ "xvd??" || $querry[0] =~ "vd?" || $querry[0] =~ "md*" ){
print "Content-type: image/png\n\n";
binmode(STDOUT);
&Header::openbox('100%', 'center', $Lang::tr{'disk usage'});
print "<table width='95%' cellspacing='5'>\n";
- open(DF,'/bin/df -B M -x rootfs|');
+ open(DF,'/bin/df -P -B M -x rootfs|');
while(<DF>){
if ($_ =~ m/^Filesystem/ ){
print <<END
close DF;
print "<tr><td colspan='7'> \n<tr><td colspan='7'><h3>Inodes</h3>\n";
- open(DF,'/bin/df -i -x rootfs|');
+ open(DF,'/bin/df -P -i -x rootfs|');
while(<DF>){
if ($_ =~ m/^Filesystem/ ){
print <<END
for(my $i = 1; $i <= $#iostat1; $i++){
if ( $i eq '1' ){
- print "<tr><td align='center' class='boldbase'><b>Device</b></td><td align='center' class='boldbase'><b>MB read</b></td><td align='center' class='boldbase'><b>MB writen</b></td></tr>";
+ print "<tr><td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB read'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB written'}</b></td></tr>";
}else{
print "<tr><td align='center'>$iostat1[$i]</td><td align='center'>$iostat2[$i]</td><td align='center'>$iostat3[$i]</td></tr>";
}
if ( $status[1]=~/standby/){
my $ftime = localtime((stat("/var/run/hddshutdown-$disk"))[9]);
- print"<B>Disk $disk status:<font color=#FF0000>".$status[1]."</font></B> (since $ftime)";
+ print"<b>Disk $disk status:<span style='color:#FF0000'>".$status[1]."</b> ($Lang::tr{'since'} $ftime)";
}else{
- print"<B>Disk $disk status:<font color=#00FF00>".$status[1]."</font></B>";
+ print"<b>Disk $disk status:<span style='color:#00FF00'>".$status[1]."</b>";
}
}
print <<END
<br /><input type="button" onClick="swapVisibility('smart_$disk')" value="$Lang::tr{'smart information'}" />
<div id='smart_$disk' style='display: none'>
- <hr /><table border=0><tr><td align=left><pre>$smart</pre></table>
+ <hr /><table border='0'><tr><td align='left'><pre>$smart</pre></table>
</div>
END
;