diff options
Diffstat (limited to 'plugin/memory.php')
| -rw-r--r-- | plugin/memory.php | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/plugin/memory.php b/plugin/memory.php index b0f6b73..ade242c 100644 --- a/plugin/memory.php +++ b/plugin/memory.php | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | require_once 'conf/common.inc.php'; | 5 | require_once 'conf/common.inc.php'; |
| 6 | require_once 'type/GenericStacked.class.php'; | 6 | require_once 'type/GenericStacked.class.php'; |
| 7 | require_once 'inc/collectd.inc.php'; | ||
| 7 | 8 | ||
| 8 | ## LAYOUT | 9 | ## LAYOUT |
| 9 | # memory/ | 10 | # memory/ |
| @@ -12,20 +13,7 @@ require_once 'type/GenericStacked.class.php'; | |||
| 12 | # memory/memory-free.rrd | 13 | # memory/memory-free.rrd |
| 13 | # memory/memory-used.rrd | 14 | # memory/memory-used.rrd |
| 14 | 15 | ||
| 15 | # grouped | 16 | $obj = new Type_GenericStacked($CONFIG['datadir']); |
| 16 | require_once 'inc/collectd.inc.php'; | ||
| 17 | $tinstance = collectd_plugindetail($host, $plugin, 'ti'); | ||
| 18 | |||
| 19 | $obj = new Type_GenericStacked; | ||
| 20 | $obj->datadir = $CONFIG['datadir']; | ||
| 21 | $obj->args = array( | ||
| 22 | 'host' => $host, | ||
| 23 | 'plugin' => $plugin, | ||
| 24 | 'pinstance' => $pinstance, | ||
| 25 | 'type' => $type, | ||
| 26 | 'tinstance' => $tinstance, | ||
| 27 | ); | ||
| 28 | $obj->data_sources = array('value'); | ||
| 29 | $obj->order = array('free', 'buffered', 'cached', 'used'); | 17 | $obj->order = array('free', 'buffered', 'cached', 'used'); |
| 30 | $obj->ds_names = array( | 18 | $obj->ds_names = array( |
| 31 | 'free' => 'Free ', | 19 | 'free' => 'Free ', |
| @@ -41,14 +29,12 @@ $obj->colors = array( | |||
| 41 | ); | 29 | ); |
| 42 | $obj->width = $width; | 30 | $obj->width = $width; |
| 43 | $obj->heigth = $heigth; | 31 | $obj->heigth = $heigth; |
| 44 | $obj->seconds = $seconds; | ||
| 45 | 32 | ||
| 46 | $obj->rrd_title = 'Physical memory utilization'; | 33 | $obj->rrd_title = 'Physical memory utilization'; |
| 47 | $obj->rrd_vertical = 'Bytes'; | 34 | $obj->rrd_vertical = 'Bytes'; |
| 48 | $obj->rrd_format = '%5.1lf%s'; | 35 | $obj->rrd_format = '%5.1lf%s'; |
| 49 | 36 | ||
| 50 | collectd_flush(ident_from_args($obj->args)); | 37 | collectd_flush($obj->identifiers); |
| 51 | |||
| 52 | $obj->rrd_graph(); | 38 | $obj->rrd_graph(); |
| 53 | 39 | ||
| 54 | ?> | 40 | ?> |
