X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fmedia.cgi;h=2aec3cce1d5a5d81c04cf3c8e7a66de6119f2fe6;hp=6a89ca86774710c29dc19f3398aa800f4b344568;hb=8b40eca59ec98f19544e68342db7ee24d5983aa6;hpb=a76779bff60174dbde43e8c42d8590a6f1b300c8 diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index 6a89ca867..2aec3cce1 100644 --- a/html/cgi-bin/media.cgi +++ b/html/cgi-bin/media.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2008 Michael Tremer & Christian Schmidt # +# Copyright (C) 2007-2013 IPFire Team # # # # 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 # @@ -45,9 +45,9 @@ my @querry = split(/\?/,$ENV{'QUERY_STRING'}); $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); @@ -70,7 +70,7 @@ if ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??"){ &Header::openbox('100%', 'center', $Lang::tr{'disk usage'}); print "\n"; - open(DF,'/bin/df -B M -x rootfs|'); + open(DF,'/bin/df -P -B M -x rootfs|'); while(){ if ($_ =~ m/^Filesystem/ ){ print <"; + print ""; }else{ print ""; } @@ -206,9 +206,9 @@ sub diskbox { if ( $status[1]=~/standby/){ my $ftime = localtime((stat("/var/run/hddshutdown-$disk"))[9]); - print"Disk $disk status:".$status[1]." (since $ftime)"; + print"Disk $disk status:".$status[1]." ($Lang::tr{'since'} $ftime)"; }else{ - print"Disk $disk status:".$status[1].""; + print"Disk $disk status:".$status[1].""; } } @@ -217,7 +217,7 @@ sub diskbox { print <
 \n

Inodes

\n"; - open(DF,'/bin/df -i -x rootfs|'); + open(DF,'/bin/df -P -i -x rootfs|'); while(){ if ($_ =~ m/^Filesystem/ ){ print <
DeviceMB readMB writen
$Lang::tr{'device'}MB readMB writen
$iostat1[$i]$iostat2[$i]$iostat3[$i]
$smart
+
$smart
END ;