mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Hinzugefuegt:
* 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
This commit is contained in:
13
config/cron/minutely/loadstat
Normal file
13
config/cron/minutely/loadstat
Normal file
@@ -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;
|
||||
@@ -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:
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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)
|
||||
|
||||
3
lfs/mc
3
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)
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user