From 4a52eae459b248456969c85b3421e1958bb521be Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Sat, 2 Feb 2008 17:46:51 +0000 Subject: [PATCH] fixed collection deamon integration git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1175 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/collectd/collectd.conf | 10 +++++----- config/rootfiles/core/7/files | 1 + config/rootfiles/core/7/update.sh | 4 ++++ html/cgi-bin/graphs.cgi | 1 - html/cgi-bin/hardwaregraphs.cgi | 4 ++-- html/cgi-bin/network.cgi | 2 +- src/initscripts/init.d/collectd | 12 ++++++------ 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/config/collectd/collectd.conf b/config/collectd/collectd.conf index e01487f50..bfb8de6d5 100644 --- a/config/collectd/collectd.conf +++ b/config/collectd/collectd.conf @@ -29,7 +29,7 @@ LoadPlugin iptables #LoadPlugin irq LoadPlugin load #LoadPlugin logfile -#LoadPlugin mbmon +LoadPlugin mbmon #LoadPlugin memcached LoadPlugin memory #LoadPlugin multimeter @@ -119,10 +119,10 @@ LoadPlugin syslog # File STDOUT # -# -# Host "127.0.0.1" -# Port "411" -# + + Host "127.0.0.1" + Port "411" + # # Host "127.0.0.1" diff --git a/config/rootfiles/core/7/files b/config/rootfiles/core/7/files index 308187ac4..6b63a1410 100644 --- a/config/rootfiles/core/7/files +++ b/config/rootfiles/core/7/files @@ -8,3 +8,4 @@ usr/local/bin/makegraphs usr/sbin/collectd var/ipfire/graphs.pl var/ipfire/menu.d/20-status.menu +var/ipfire/langs diff --git a/config/rootfiles/core/7/update.sh b/config/rootfiles/core/7/update.sh index 85c6d53df..14eea1693 100644 --- a/config/rootfiles/core/7/update.sh +++ b/config/rootfiles/core/7/update.sh @@ -4,3 +4,7 @@ extract_files ln -s /etc/rc.d/rc0.d/K50collectd /etc/init.d/collectd ln -s /etc/rc.d/rc3.d/S20collectd /etc/init.d/collectd ln -s /etc/rc.d/rc6.d/K50collectd /etc/init.d/collectd +GATEWAY=$(cat /var/ipfire/red/remote-ipaddress) +echo "$GATEWAY gateway" >> /etc/hosts +/etc/init.d/collectd start +perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang" diff --git a/html/cgi-bin/graphs.cgi b/html/cgi-bin/graphs.cgi index 282cb5659..4c7c7e181 100644 --- a/html/cgi-bin/graphs.cgi +++ b/html/cgi-bin/graphs.cgi @@ -51,7 +51,6 @@ if ($cgigraphs[1] =~ /(cpu)/) {&Graphs::updatecpugraph ("hour");&Graphs::updatec if ($cgigraphs[1] =~ /(memory|swap)/) {&Graphs::updatememgraph ("hour");&Graphs::updatememgraph ("week");&Graphs::updatememgraph ("month");&Graphs::updatememgraph ("year");} if ($cgigraphs[1] =~ /disk/){ my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; - push(@devices,"uba"); foreach (@devices) { my $device = $_; chomp($device); diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index 0c8881877..22b20485f 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -151,10 +151,10 @@ sub graphbox { &Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}"); if (-e "$graphdir/mbmon-$graph-week.png"){ - my $ftime = localtime((stat("$graphdir/mbmon-$graph-day.png"))[9]); + my $ftime = localtime((stat("$graphdir/mbmon-$graph-week.png"))[9]); print "
"; print "$Lang::tr{'the statistics were last updated at'}: $ftime

\n"; - print "
"; + print "
"; } else{print $Lang::tr{'no information available'};} &Header::closebox(); diff --git a/html/cgi-bin/network.cgi b/html/cgi-bin/network.cgi index 53e2cfc9a..17febf732 100644 --- a/html/cgi-bin/network.cgi +++ b/html/cgi-bin/network.cgi @@ -51,7 +51,7 @@ $cgiparams[1] = '' unless defined $cgiparams[1]; if ($cgiparams[1] =~ /red/) { &Header::openpage($Lang::tr{'network traffic graphs external'}, 1, ''); push (@graphs, ($netsettings{'RED_DEV'})); - push (@graphs, ("ipsec0")); + if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-ipsec0.rrd") {push (@graphs, ("ipsec0")); }elsif ($cgiparams[1] =~ /other/) { &Header::openpage($Lang::tr{'network traffic graphs others'}, 1, ''); push (@graphs, ("lq")); diff --git a/src/initscripts/init.d/collectd b/src/initscripts/init.d/collectd index f3fa208b2..e6ee26845 100644 --- a/src/initscripts/init.d/collectd +++ b/src/initscripts/init.d/collectd @@ -11,15 +11,15 @@ case "$1" in /usr/sbin/collectd -C /etc/collectd.conf evaluate_retval # for disk in `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; do boot_mesg "Bringing up hddtemp daemon for $disk ..."; /usr/sbin/hddtemp $disk -d -l localhost; evaluate_retval; done -# boot_mesg "Bringing up mbmon daemon..." -# /usr/bin/mbmon -P 411 -r -# evaluate_retval + boot_mesg "Bringing up mbmon daemon..." + /usr/bin/mbmon -P 411 -r + evaluate_retval ;; stop) -# boot_mesg "Stopping mbmon daemon..." -# killproc /usr/bin/mbmon -# evaluate_retval + boot_mesg "Stopping mbmon daemon..." + killproc /usr/bin/mbmon + evaluate_retval # boot_mesg "Stopping hddtemp daemon..." # killproc /usr/sbin/hddtemp # evaluate_retval