diff options
| author | Pim van den Berg | 2011-06-15 22:34:21 +0200 |
|---|---|---|
| committer | Pim van den Berg | 2011-06-15 22:34:21 +0200 |
| commit | 9dd8be51f0469d21cd879604bcfff9cb05f40806 (patch) | |
| tree | 8e55cf40c36873a5ebd6cc1afb8d716d0f917967 | |
| parent | log unixsock errors instead of printing them (diff) | |
| download | apt-panopticon_cgp-9dd8be51f0469d21cd879604bcfff9cb05f40806.zip apt-panopticon_cgp-9dd8be51f0469d21cd879604bcfff9cb05f40806.tar.gz apt-panopticon_cgp-9dd8be51f0469d21cd879604bcfff9cb05f40806.tar.bz2 apt-panopticon_cgp-9dd8be51f0469d21cd879604bcfff9cb05f40806.tar.xz | |
plugin/df: collectd 5 compatibility
| -rw-r--r-- | plugin/df.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/plugin/df.php b/plugin/df.php index 7847b4e..b5c7e73 100644 --- a/plugin/df.php +++ b/plugin/df.php | |||
| @@ -8,25 +8,35 @@ require_once 'inc/collectd.inc.php'; | |||
| 8 | 8 | ||
| 9 | # LAYOUT | 9 | # LAYOUT |
| 10 | # | 10 | # |
| 11 | # df/ | 11 | # df-X/df_complex-free.rrd |
| 12 | # df/df-XXXX.rrd | 12 | # df-X/df_complex-reserved.rrd |
| 13 | # df-X/df_complex-used.rrd | ||
| 13 | 14 | ||
| 14 | $obj = new Type_GenericStacked($CONFIG); | 15 | $obj = new Type_GenericStacked($CONFIG); |
| 15 | $obj->data_sources = array('free', 'used'); | 16 | $obj->data_sources = array('value'); |
| 17 | $obj->order = array('reserved', 'free', 'used'); | ||
| 16 | $obj->ds_names = array( | 18 | $obj->ds_names = array( |
| 19 | 'reserved' => 'Reserved', | ||
| 17 | 'free' => 'Free', | 20 | 'free' => 'Free', |
| 18 | 'used' => 'Used', | 21 | 'used' => 'Used', |
| 19 | ); | 22 | ); |
| 20 | $obj->colors = array( | 23 | $obj->colors = array( |
| 24 | 'reserved' => 'aaaaaa', | ||
| 21 | 'free' => '00ff00', | 25 | 'free' => '00ff00', |
| 22 | 'used' => 'ff0000', | 26 | 'used' => 'ff0000', |
| 23 | ); | 27 | ); |
| 24 | $obj->width = $width; | 28 | $obj->width = $width; |
| 25 | $obj->heigth = $heigth; | 29 | $obj->heigth = $heigth; |
| 26 | 30 | ||
| 27 | $obj->rrd_title = sprintf('Free space (%s)', $obj->args['tinstance']); | 31 | $obj->rrd_title = sprintf('Free space (%s)', $obj->args['pinstance']); |
| 28 | $obj->rrd_vertical = 'Bytes'; | 32 | $obj->rrd_vertical = 'Bytes'; |
| 29 | $obj->rrd_format = '%5.1lf%sB'; | 33 | $obj->rrd_format = '%5.1lf%sB'; |
| 30 | 34 | ||
| 35 | # backwards compatibility | ||
| 36 | if ($CONFIG['version'] < 5) { | ||
| 37 | $obj->data_sources = array('free', 'used'); | ||
| 38 | $obj->rrd_title = sprintf('Free space (%s)', $obj->args['tinstance']); | ||
| 39 | } | ||
| 40 | |||
| 31 | collectd_flush($obj->identifiers); | 41 | collectd_flush($obj->identifiers); |
| 32 | $obj->rrd_graph(); | 42 | $obj->rrd_graph(); |
