]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/system.cgi
makegraphs umgebaut, sodass nurnoch rrd daten geschrieben werden die graphen
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / system.cgi
index d556abc084d55a3e0fa28634902aa1bf3005b5dc..02f03842202753d44f99df4c65930b005ecbaa21 100644 (file)
@@ -17,6 +17,7 @@ use CGI::Carp 'fatalsToBrowser';
 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} );
@@ -25,6 +26,11 @@ undef (@dummy);
 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
@@ -59,12 +65,19 @@ if ($netsettings{'BLUE_DEV'} ne '') {
         $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'}");
@@ -101,63 +114,21 @@ print <<END
 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