X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fgraphs.cgi;h=a29459671f107f073a5dee7a2f88590b8e203eda;hb=d9b7aa3334dbe9bcb73f8e2394cac9e1f05dc0eb;hp=f19e5a618e4cc8cdf15a38badcb49c24df00a1b3;hpb=072cd9978e0276d584e0c36384b6721eeaf3a993;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/html/cgi-bin/graphs.cgi b/html/cgi-bin/graphs.cgi index f19e5a618e..a29459671f 100644 --- a/html/cgi-bin/graphs.cgi +++ b/html/cgi-bin/graphs.cgi @@ -15,7 +15,7 @@ use strict; #use warnings; #use CGI::Carp 'fatalsToBrowser'; -require 'CONFIG_ROOT/general-functions.pl'; +require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; @@ -40,6 +40,25 @@ if ($cgigraphs[1] =~ /(network|GREEN|BLUE|ORANGE|RED|lq)/) { } else { &Header::openpage($Lang::tr{'system graphs'}, 1, ''); } + +sub diskbox { + my $disk = $_[0]; + if (-e "$graphdir/disk-$disk-day.png") { + + &Header::openbox('100%', 'center', "Disk /dev/$disk $Lang::tr{'graph'}"); + my $ftime = localtime((stat("$graphdir/disk-$disk-day.png"))[9]); + print "
$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; + print ""; + print ""; + print ""; + print "
\n"; + if (-e "/usr/local/bin/hddshutdown-state") { + system("/usr/local/bin/hddshutdown-state $disk"); + } + &Header::closebox(); + } +} + &Header::openbigbox('100%', 'left'); if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq|cpu|memory|swap|disk)/) { @@ -143,6 +162,15 @@ if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq|cpu|memory|swap|disk)/) { } print "
\n"; &Header::closebox(); + + diskbox("hda"); + diskbox("hdb"); + diskbox("hdc"); + diskbox("hdd"); + diskbox("hde"); + diskbox("hdf"); + diskbox("hdg"); + diskbox("hdh"); } &Header::closebigbox();