X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fhardwaregraphs.cgi;h=b0e925439fdfb4c0fc91783a2ee79ee9903f991a;hp=d03f3f2b22f3b0a71967b513373df1c8a38d0eda;hb=e056ca737a5d9069df87665ac9486784d2bf07d5;hpb=30189c5045390ca07dd0aa0c0619964553f674b3 diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index d03f3f2b2..b0e925439 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2008 Michael Tremer & Christian Schmidt # +# Copyright (C) 2005-2010 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 # @@ -67,11 +67,7 @@ if ( $querry[0] =~ "hwtemp"){ print "Content-type: image/png\n\n"; binmode(STDOUT); &Graphs::updatethermaltempgraph($querry[1]); -}elsif ( $querry[0] =~ "thermalcooling"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatethermalcoolinggraph($querry[1]); -}elsif ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" ){ +}elsif ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??" ){ print "Content-type: image/png\n\n"; binmode(STDOUT); &Graphs::updatehddgraph($querry[0],$querry[1]); @@ -87,13 +83,17 @@ if ( $querry[0] =~ "hwtemp"){ chomp($_); $_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/; my $label = $2.$3;$label=~ s/-//g; - if ( $sensorsettings{'LINE-'.$label} ne "on" ){$sensorsettings{'LINE-'.$label} = 'off';} - elsif ( $sensorsettings{'LINE-'.$label} eq "on" ){$sensorsettings{'LINE-'.$label} = 'checked';} + if ( $sensorsettings{'LINE-'.$label} ne "on" ){ + $sensorsettings{'LINE-'.$label} = 'off'; + } elsif ($sensorsettings{'LINE-'.$label} eq "on" ){ + $sensorsettings{'LINE-'.$label} = 'checked'; + } + $sensorsettings{'LABEL-'.$label} =~ s/\W//g; } &General::writehash("${General::swroot}/sensors/settings", \%sensorsettings); } - my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; + my @disks = `kudzu -qps -c HD 2>/dev/null | grep device: | cut -d" " -f2 | sort | uniq`; foreach (@disks){ my $disk = $_; @@ -105,32 +105,32 @@ if ( $querry[0] =~ "hwtemp"){ &Header::closebox(); } - if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/thermal-thermal_zone*` ) { - &Header::openbox('100%', 'center', "ACPI Thermal-Zone Temp $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","thermaltemp","day"); - &Header::closebox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/thermal-thermal_zone* 2>/dev/null` ) { + &Header::openbox('100%', 'center', "ACPI Thermal-Zone Temp $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","thermaltemp","day"); + &Header::closebox(); } - if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/thermal-thermal_zone*` ) { - &Header::openbox('100%', 'center', "ACPI Thermal-Zone Cooling $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","thermalcooling","day"); - &Header::closebox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/temperature-* 2>/dev/null` ) { + &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day","375"); + Header::closebox(); } - if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sonsors-*` ) { - &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day"); - &Header::closebox(); - - &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); - &Header::closebox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/fanspeed-* 2>/dev/null` ) { + &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); + &Header::closebox(); + } - &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day","375"); - &Header::closebox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/voltage-* 2>/dev/null` ) { + &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day","435"); + &Header::closebox(); + } - sensorsbox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-* 2>/dev/null` ) { + sensorsbox(); } &Header::closebigbox(); &Header::closepage();