-if ($cgigraphs[1] =~ /hddtemp/)
-{
- my $graph = $cgigraphs[1];
- my $graphname = $Lang::tr{"harddisk temperature"};
- &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
-
- if (-e "$graphdir/${graph}-day.png")
- {
- my $ftime = localtime((stat("$graphdir/${graph}-day.png"))[9]);
- print "<center>";
- print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n";
- print "<img src='/graphs/${graph}-day.png' border='0' /><hr />";
- print "<img src='/graphs/${graph}-week.png' border='0' /><hr />";
- print "<img src='/graphs/${graph}-month.png' border='0' /><hr />";
- print "<img src='/graphs/${graph}-year.png' border='0' />";
- if ( -e "/var/log/smartctl_out_${graph}" )
- {
- my $output = `/bin/cat /var/log/smartctl_out_${graph}`;
- $output = &Header::cleanhtml($output);
- print "<hr><table border=0><tr><td align=left><pre>$output</pre></table>\n";
- }
- }
- else
- {
- print $Lang::tr{'no information available'};
- }
- &Header::closebox();
- print "<div align='center'><table width='80%'><tr><td align='center'>";
- print "<a href='/cgi-bin/hardwaregraphs.cgi'>";
- print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
-}
-elsif ($cgigraphs[1] =~ /(temp|fan|volt)/)
-{
-if ($cgigraphs[1] =~ /temp/) {&Graphs::updatetempgraph ("week");&Graphs::updatetempgraph ("month");&Graphs::updatetempgraph ("year");}
-if ($cgigraphs[1] =~ /fan/) {&Graphs::updatefangraph ("week");&Graphs::updatefangraph ("month");&Graphs::updatefangraph ("year");}
-if ($cgigraphs[1] =~ /volt/) {&Graphs::updatevoltgraph ("week");&Graphs::updatevoltgraph ("month");&Graphs::updatevoltgraph ("year");}
-
- my $graph = $cgigraphs[1];
- my $graphname = $Lang::tr{"mbmon $cgigraphs[1]"};
- &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
-
- if (-e "$graphdir/mbmon-${graph}-day.png")
- {
- my $ftime = localtime((stat("$graphdir/mbmon-${graph}-day.png"))[9]);
- print "<center>";
- print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n";
- print "<img src='/graphs/mbmon-${graph}-day.png' border='0' /><hr />";
- print "<img src='/graphs/mbmon-${graph}-week.png' border='0' /><hr />";
- print "<img src='/graphs/mbmon-${graph}-month.png' border='0' /><hr />";
- print "<img src='/graphs/mbmon-${graph}-year.png' border='0' />";
- }
- else
- {
- print $Lang::tr{'no information available'};
- }
- &Header::closebox();
- print "<div align='center'><table width='80%'><tr><td align='center'>";
- print "<a href='/cgi-bin/hardwaregraphs.cgi'>";
- print "$Lang::tr{'back'}</a></td></tr></table></div>\n";
-}
-else
-{
- if ( $mbmon_settings{'GRAPH_TEMP'} == 1 )
- {
- &Header::openbox('100%', 'center', "$Lang::tr{'mbmon temp'} $Lang::tr{'graph'}");
- if (-e "$graphdir/mbmon-temp-day.png")
- {
- my $ftime = localtime((stat("$graphdir/mbmon-temp-day.png"))[9]);
- print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
- print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=temp'>";
- print "<img src='/graphs/mbmon-temp-day.png' border='0' />";
- print "</a>";
- }
- else
- {
- print $Lang::tr{'no information available'};
- }
- print "<br />\n";
- &Header::closebox();
- }
-
- if ( $mbmon_settings{'GRAPH_FAN'} == 1 )
- {
- &Header::openbox('100%', 'center', "$Lang::tr{'mbmon fan'} $Lang::tr{'graph'}");
- if (-e "$graphdir/mbmon-fan-day.png")
- {
- my $ftime = localtime((stat("$graphdir/mbmon-fan-day.png"))[9]);
- print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
- print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=fan'>";
- print "<img src='/graphs/mbmon-fan-day.png' border='0' />";
- print "</a>";
- }
- else
- {
- print $Lang::tr{'no information available'};
- }
- print "<br />\n";
- &Header::closebox();
- }
-
- if ( $mbmon_settings{'GRAPH_VOLT'} == 1 )
- {
- &Header::openbox('100%', 'center', "$Lang::tr{'mbmon volt'} $Lang::tr{'graph'}");
- if (-e "$graphdir/mbmon-volt-day.png")
- {
- my $ftime = localtime((stat("$graphdir/mbmon-volt-day.png"))[9]);
- print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
- print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=volt'>";
- print "<img src='/graphs/mbmon-volt-day.png' border='0' />";
- print "</a>";
- }
- else
- {
- print $Lang::tr{'no information available'};
- }
- print "<br />\n";
- &Header::closebox();
- }
-
- if ( $mbmon_settings{'GRAPH_HDD'} == 1 )
- {
- my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
- foreach (@devices) {
- my $device = $_;
- chomp($device);
- hddtempbox($device);}
- }
-
- &Header::openbox('100%', 'center', $Lang::tr{'settings'});
-print <<END