X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fmedia.cgi;h=4c94d1c8dd8b3d6b4cf8bf111da885c109329e24;hb=HEAD;hp=4fe472a029f5c0002c57ec7eb5313b90dfe082b7;hpb=e35760be61286dd2c85185d5d136927df737af56;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index 4fe472a02..4c94d1c8d 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?" ){ +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?" ){ &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'}$Lang::tr{'MB read'}$Lang::tr{'MB written'}
$iostat1[$i]$iostat2[$i]$iostat3[$i]
$smart
+
$smart
END ;