diff options
Diffstat (limited to '')
| -rw-r--r-- | plugin/df.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/plugin/df.php b/plugin/df.php new file mode 100644 index 0000000..6398249 --- /dev/null +++ b/plugin/df.php | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | # Collectd Df plugin | ||
| 4 | |||
| 5 | require_once $CONFIG['webdir'].'/conf/config.php'; | ||
| 6 | require_once $CONFIG['webdir'].'/type/GenericStacked.class.php'; | ||
| 7 | |||
| 8 | # LAYOUT | ||
| 9 | # | ||
| 10 | # df/ | ||
| 11 | # df/df-XXXX.rrd | ||
| 12 | |||
| 13 | $obj = new Type_GenericStacked; | ||
| 14 | $obj->datadir = $CONFIG['datadir']; | ||
| 15 | $obj->path_format = '{host}/{plugin}/{type}-{tinstance}.rrd'; | ||
| 16 | $obj->args = array( | ||
| 17 | 'host' => $host, | ||
| 18 | 'plugin' => $plugin, | ||
| 19 | 'pinstance' => $pinstance, | ||
| 20 | 'type' => $type, | ||
| 21 | 'tinstance' => $tinstance, | ||
| 22 | ); | ||
| 23 | $obj->data_sources = array('free', 'used'); | ||
| 24 | $obj->ds_names = array( | ||
| 25 | 'free' => 'Free', | ||
| 26 | 'used' => 'Used', | ||
| 27 | ); | ||
| 28 | $obj->colors = array( | ||
| 29 | 'free' => '00ff00', | ||
| 30 | 'used' => 'ff0000', | ||
| 31 | ); | ||
| 32 | $obj->width = $width; | ||
| 33 | $obj->heigth = $heigth; | ||
| 34 | $obj->seconds = $seconds; | ||
| 35 | |||
| 36 | $obj->rrd_title = "Free space ($tinstance) on $host"; | ||
| 37 | $obj->rrd_vertical = 'Bytes'; | ||
| 38 | $obj->rrd_format = '%5.1lf%sB'; | ||
| 39 | |||
| 40 | $obj->rrd_graph(); | ||
| 41 | |||
| 42 | ?> | ||
