From 488b4f3ea230b0bc3cb7fa7e5264691e21067cd0 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Wed, 4 Nov 2009 23:04:30 +0100 Subject: 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. --- inc/html.inc.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'inc/html.inc.php') 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 @@ require_once 'conf/common.inc.php'; require_once 'inc/rrdtool.class.php'; +require_once 'inc/collectd.inc.php'; function html_start() { global $CONFIG; @@ -46,6 +47,7 @@ function host_summary($hosts) { echo "\n"; foreach($hosts as $host) { + collectd_flush(sprintf('%s/load/load', $host)); $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd'); if (!$rrd_info) continue; -- cgit v1.1