require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
+require "${General::swroot}/graphs.pl";
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::colourred} );
my %netsettings=();
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
my %cgiparams=();
# Maps a nice printable name to the changing part of the pid file, which
# is also the name of the program
$servicenames{"$Lang::tr{'intrusion detection system'} (BLUE)"} = "snort_$netsettings{'BLUE_DEV'}";
}
-&Header::showhttpheaders();
+# Generate Graphs from rrd Data
+&Graphs::updatecpugraph ("day");
+&Graphs::updatecpugraph ("week");
+&Graphs::updatecpugraph ("month");
+&Graphs::updatecpugraph ("year");
+&Graphs::updateloadgraph ("day");
+&Graphs::updateloadgraph ("week");
+&Graphs::updateloadgraph ("month");
+&Graphs::updateloadgraph ("year");
+&Header::showhttpheaders();
&Header::getcgihash(\%cgiparams);
-
&Header::openpage($Lang::tr{'status information'}, 1, '');
-
&Header::openbigbox('100%', 'left');
&Header::openbox('100%', 'center', "CPU $Lang::tr{'graph'}");
END
;
-my $lines = 0;
my $key = '';
foreach $key (sort keys %servicenames)
{
- if ($lines % 2) {
- print "<tr bgcolor='${Header::table1colour}'>\n"; }
- else {
- print "<tr bgcolor='${Header::table2colour}'>\n"; }
- print "<td align='left'>$key</td>\n";
+ print "<tr>\n<td align='left'>$key</td>\n";
my $shortname = $servicenames{$key};
my $status = &isrunning($shortname);
print "$status\n";
print "</tr>\n";
- $lines++;
}
print "</table></div>\n";
&Header::closebox();
-
-&Header::openbox('100%', 'left', $Lang::tr{'loaded modules'});
-my $module = qx(/bin/lsmod | awk -F" " '{print \$1}');
-my $size = qx(/bin/lsmod | awk -F" " '{print \$2}');
-my $used = qx(/bin/lsmod | awk -F" " '{print \$3}');
-my @usedby = qx(/bin/lsmod | awk -F" " '{print \$4}');
-my @usedbyf;
-my $usedbyline;
-
-foreach $usedbyline(@usedby)
-{
-my $laenge = length($usedbyline);
-
-if ( $laenge > 30)
- {
- my $usedbylinef=substr($usedbyline,0,30);
- $usedbyline="$usedbylinef ...\n";
- push(@usedbyf,$usedbyline);
- }
-else
- {push(@usedbyf,$usedbyline);}
-}
-print <<END
-<table cellspacing=25><tr>
-<td><pre>$module</pre></td>
-<td><pre>$size</pre></td>
-<td><pre>$used</pre></td>
-<td><pre>@usedbyf</pre></td>
-</tr></table>
-END
-;
-
-print "";
-&Header::closebox();
-
&Header::closebigbox();
-
&Header::closepage();
sub isrunning