X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fhardwaregraphs.cgi;h=dabdfd1aeeeed3af82f9f4c384890de0b622e1d0;hb=324cae81712b7b1b7b80333ad92e369cac28b6ce;hp=73885a0d7e6445d28d9e8429208e594ad93c975c;hpb=824a0f689e6269c178e54feeaba878078bb6a49b;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index 73885a0d7e..dabdfd1aee 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -63,7 +63,11 @@ if ( $querry[0] =~ "hwtemp"){ print "Content-type: image/png\n\n"; binmode(STDOUT); &Graphs::updatehwvoltgraph($querry[1]); -}elsif ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" ){ +}elsif ( $querry[0] =~ "thermaltemp"){ + print "Content-type: image/png\n\n"; + binmode(STDOUT); + &Graphs::updatethermaltempgraph($querry[1]); +}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]); @@ -79,8 +83,12 @@ 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); } @@ -97,20 +105,33 @@ if ( $querry[0] =~ "hwtemp"){ &Header::closebox(); } - &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day"); - &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(); + } - &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); - &Header::closebox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/temperature-*` ) { + &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day","375"); + 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-*/fanspeed-*` ) { + &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); + &Header::closebox(); + } - sensorsbox(); + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/voltage-*` ) { + &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day","435"); + &Header::closebox(); + } + if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*` ) { + sensorsbox(); + } &Header::closebigbox(); &Header::closepage();