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=490ffcad94d98406dbfeb3a048d0a8cb72dc1b4d;hb=8b40eca59ec98f19544e68342db7ee24d5983aa6;hpb=4e481c3a517c27fae6b8e7056fb8a5fdd05c9188 diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index 490ffcad9..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?" ){ +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 ""; } @@ -195,8 +195,8 @@ sub diskbox { my $disk = $_[0]; chomp $disk; my @status; - if (-e "/tmp/hddstatus"){ - open(DATEI, "; close(DATEI); @@ -205,10 +205,10 @@ sub diskbox { } if ( $status[1]=~/standby/){ - my $ftime = localtime((stat("/tmp/hddshutdown-$disk"))[9]); - print"Disk $disk status:".$status[1]." (since $ftime)"; + my $ftime = localtime((stat("/var/run/hddshutdown-$disk"))[9]); + 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 ;