diff options
author | Pim van den Berg | 2009-11-04 23:04:30 +0100 |
---|---|---|
committer | Pim van den Berg | 2009-11-04 23:04:30 +0100 |
commit | 488b4f3ea230b0bc3cb7fa7e5264691e21067cd0 (patch) | |
tree | 67944684b708f9e2998eeeb0200e608f1f451a36 /plugin/swap.php | |
parent | remove path_format from plugins (diff) | |
download | apt-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 'plugin/swap.php')
-rw-r--r-- | plugin/swap.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugin/swap.php b/plugin/swap.php index 7160ec3..18c6242 100644 --- a/plugin/swap.php +++ b/plugin/swap.php | |||
@@ -44,6 +44,8 @@ $obj->rrd_title = "Swap utilization on $host"; | |||
44 | $obj->rrd_vertical = 'Bytes'; | 44 | $obj->rrd_vertical = 'Bytes'; |
45 | $obj->rrd_format = '%5.1lf%s'; | 45 | $obj->rrd_format = '%5.1lf%s'; |
46 | 46 | ||
47 | collectd_flush(ident_from_args($obj->args)); | ||
48 | |||
47 | $obj->rrd_graph(); | 49 | $obj->rrd_graph(); |
48 | 50 | ||
49 | ?> | 51 | ?> |