aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/html.inc.php
diff options
context:
space:
mode:
authorPim van den Berg2009-11-04 23:04:30 +0100
committerPim van den Berg2009-11-04 23:04:30 +0100
commit488b4f3ea230b0bc3cb7fa7e5264691e21067cd0 (patch)
tree67944684b708f9e2998eeeb0200e608f1f451a36 /inc/html.inc.php
parentremove path_format from plugins (diff)
downloadapt-panopticon_cgp-488b4f3ea230b0bc3cb7fa7e5264691e21067cd0.zip
apt-panopticon_cgp-488b4f3ea230b0bc3cb7fa7e5264691e21067cd0.tar.gz
apt-panopticon_cgp-488b4f3ea230b0bc3cb7fa7e5264691e21067cd0.tar.bz2
apt-panopticon_cgp-488b4f3ea230b0bc3cb7fa7e5264691e21067cd0.tar.xz
add unixsock flush support
Via the UnixSock plugin of Collectd it is possible to send commands to the Collectd daemon. One of the commands is the FLUSH command, which you can use to let the daemon write cached data to the rrd files. CGP uses the FLUSH command before generating a graph and before showing the load information on the main page. In this case the information shown via CGP is always up-to-date. Also when you have configured the RRDTool plugin of Collectd with a CacheTimeout setting. This commit includes code based on functions collectd_identifier and collectd_flush from php-collection by Bruno Prémont.
Diffstat (limited to 'inc/html.inc.php')
-rw-r--r--inc/html.inc.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php
index cbe3ad2..09da518 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -2,6 +2,7 @@
2 2
3require_once 'conf/common.inc.php'; 3require_once 'conf/common.inc.php';
4require_once 'inc/rrdtool.class.php'; 4require_once 'inc/rrdtool.class.php';
5require_once 'inc/collectd.inc.php';
5 6
6function html_start() { 7function html_start() {
7 global $CONFIG; 8 global $CONFIG;
@@ -46,6 +47,7 @@ function host_summary($hosts) {
46 echo "<table class=\"summary\">\n"; 47 echo "<table class=\"summary\">\n";
47 48
48 foreach($hosts as $host) { 49 foreach($hosts as $host) {
50 collectd_flush(sprintf('%s/load/load', $host));
49 $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd'); 51 $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd');
50 if (!$rrd_info) 52 if (!$rrd_info)
51 continue; 53 continue;