Hinzugefuegt:
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 28 Aug 2006 14:18:38 +0000 (14:18 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 28 Aug 2006 14:18:38 +0000 (14:18 +0000)
  * Load Average Graphen
Geaendert:
  * MC - Tasten F1 bis F5 sollten wieder gehen.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@259 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

config/cron/minutely/loadstat [new file with mode: 0644]
doc/ChangeLog
html/cgi-bin/graphs.cgi
lfs/fcron
lfs/mc
src/scripts/makegraphs

diff --git a/config/cron/minutely/loadstat b/config/cron/minutely/loadstat
new file mode 100644 (file)
index 0000000..9c6fdb9
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+use RRDs;
+my $LOAD = '';
+my $CMD = "awk '{print \$1\":\"\$2\":\"\$3}' < /proc/loadavg";
+$LOAD=`$CMD`;
+chomp($LOAD);
+RRDs::update ("/var/log/rrd/load.rrd",
+       "-t", "load1:load5:load15",
+       "N:$LOAD");
+
+my $ERROR = RRDs::error;
+print "$ERROR\n" if $ERROR;
index 999984b..5dbdd64 100644 (file)
@@ -1,4 +1,13 @@
 ------------------------------------------------------------------------
+r258 | ms | 2006-08-26 15:20:12 +0200 (Sat, 26 Aug 2006) | 6 lines
+
+Hinzugefuegt:
+  * QoS-Graphen - Erste Version!
+Pakete:
+  * Applejuice bearbeitet
+  * Depends.txt in alle eingefuegt
+  * Clamav bearbeitet
+------------------------------------------------------------------------
 r257 | ms | 2006-08-26 10:42:48 +0200 (Sat, 26 Aug 2006) | 5 lines
 
 Update:
index a294596..fbc4844 100644 (file)
@@ -61,7 +61,7 @@ sub diskbox {
 
 &Header::openbigbox('100%', 'left');
 
-if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq|cpu|memory|swap|disk)/) {
+if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq|cpu|memory|swap|disk|load)/) {
        my $graph = $cgigraphs[1];
        my $graphname = ucfirst(lc($cgigraphs[1]));
        &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
@@ -124,6 +124,19 @@ if ($cgigraphs[1] =~ /(GREEN|BLUE|ORANGE|RED|lq|cpu|memory|swap|disk)/) {
        print "<br />\n";
        &Header::closebox();
 
+       &Header::openbox('100%', 'center', "Load $Lang::tr{'graph'}");
+       if (-e "$graphdir/load-day.png") {
+               my $ftime = localtime((stat("$graphdir/load-day.png"))[9]);
+               print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
+               print "<a href='/cgi-bin/graphs.cgi?graph=load'>";
+               print "<img src='/graphs/load-day.png' border='0' />";
+               print "</a>";
+       } else {
+               print $Lang::tr{'no information available'};
+       }
+       print "<br />\n";
+       &Header::closebox();
+
        &Header::openbox('100%', 'center', "Memory $Lang::tr{'graph'}");
        if (-e "$graphdir/memory-day.png") {
                my $ftime = localtime((stat("$graphdir/memory-day.png"))[9]);
index 4f2589f..1db9b9b 100644 (file)
--- a/lfs/fcron
+++ b/lfs/fcron
@@ -89,6 +89,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        chmod u-s /usr/bin/fcrontab /usr/bin/fcronsighup
        mkdir -p /etc/fcron.minutely /etc/fcron.cyclic /etc/fcron.hourly \
                /etc/fcron.daily /etc/fcron.weekly /etc/fcron.monthly
+       cp -vf $(DIR_CONF)/cron/minutely/* /etc/fcron.minutely
+       chmod -v 755 /etc/fcron.minutely/*
        /usr/bin/fcrontab $(DIR_SRC)/config/cron/crontab
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/lfs/mc b/lfs/mc
index b8901f4..8b27ba0 100644 (file)
--- a/lfs/mc
+++ b/lfs/mc
@@ -78,7 +78,8 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && ./configure --prefix=/usr --without-x --disable-nls
+       cd $(DIR_APP) && ./configure --prefix=/usr --without-x --disable-nls \
+                               --with-screen=mcslang # --with-samba
        cd $(DIR_APP) && make
        cd $(DIR_APP) && make install
        @rm -rf $(DIR_APP)
index 8f9aa67..03a53fe 100644 (file)
@@ -184,6 +184,47 @@ sub updatecpudata {
 
 }
 
+sub updateloadgraph {
+       my $period    = $_[0];
+
+       RRDs::graph ("$graphs/load-$period.png",
+               "--start", "-1$period", "-aPNG",
+               "-w 600", "-h 100", "-i", "-z", "-l 0", "-r", "--alt-y-grid",
+               "-t Load Average",
+               "--color", "SHADEA#EAE9EE",
+               "--color", "SHADEB#EAE9EE",
+               "--color", "BACK#FFFFFF",
+               "DEF:load1=$rrdlog/load.rrd:load1:AVERAGE",
+               "DEF:load5=$rrdlog/load.rrd:load5:AVERAGE",
+               "DEF:load15=$rrdlog/load.rrd:load15:AVERAGE",
+               "AREA:load1#ff0000:1 Minute, letzter\:",
+               "GPRINT:load1:LAST:%5.2lf\n",
+               "AREA:load5#ff9900:5 Minuten, letzter\:",
+               "GPRINT:load5:LAST:%5.2lf\n",
+               "AREA:load15#ffff00:15 Minuten, letzter\:",
+               "GPRINT:load15:LAST:%5.2lf",
+               "LINE1:load5#ff9900:",
+               "LINE1:load1#ff0000:");
+       $ERROR = RRDs::error;
+       print "Error in RRD::graph for load: $ERROR\n" if $ERROR;
+}
+
+sub updateloaddata {
+       if ( ! -e "$rrdlog/load.rrd") {
+               RRDs::create ("$rrdlog/load.rrd", "--step=60",
+                       "DS:load1:GAUGE:120:0:U",
+                       "DS:load5:GAUGE:120:0:U",
+                       "DS:load15:GAUGE:120:0:U",
+                       "RRA:AVERAGE:0.5:1:2160",
+                       "RRA:AVERAGE:0.5:5:2016",
+                       "RRA:AVERAGE:0.5:15:2880",
+                       "RRA:AVERAGE:0.5:60:8760");
+
+               $ERROR = RRDs::error;
+               print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
+       }
+}
+
 sub updatememgraph {
        my $period    = $_[0];
 
@@ -1013,6 +1054,12 @@ updatecpugraph ("week");
 updatecpugraph ("month");
 updatecpugraph ("year");
 
+updateloaddata();
+updateloadgraph ("day");
+updateloadgraph ("week");
+updateloadgraph ("month");
+updateloadgraph ("year");
+
 updatememdata();
 updatememgraph ("day");
 updatememgraph ("week");