diff options
Diffstat (limited to '')
-rw-r--r-- | plugin/cpu.php | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/plugin/cpu.php b/plugin/cpu.php index 4cc74f6..d4097b0 100644 --- a/plugin/cpu.php +++ b/plugin/cpu.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 | # cpu-X/ | 10 | # cpu-X/ |
@@ -16,19 +17,7 @@ require_once 'type/GenericStacked.class.php'; | |||
16 | # cpu-X/cpu-user.rrd | 17 | # cpu-X/cpu-user.rrd |
17 | # cpu-X/cpu-wait.rrd | 18 | # cpu-X/cpu-wait.rrd |
18 | 19 | ||
19 | # grouped | 20 | $obj = new Type_GenericStacked($CONFIG['datadir']); |
20 | require_once 'inc/collectd.inc.php'; | ||
21 | $tinstance = collectd_plugindetail($host, $plugin, 'ti'); | ||
22 | |||
23 | $obj = new Type_GenericStacked; | ||
24 | $obj->datadir = $CONFIG['datadir']; | ||
25 | $obj->args = array( | ||
26 | 'host' => $host, | ||
27 | 'plugin' => $plugin, | ||
28 | 'pinstance' => $pinstance, | ||
29 | 'type' => $type, | ||
30 | 'tinstance' => $tinstance, | ||
31 | ); | ||
32 | $obj->data_sources = array('value'); | 21 | $obj->data_sources = array('value'); |
33 | $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); | 22 | $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); |
34 | $obj->ds_names = array( | 23 | $obj->ds_names = array( |
@@ -53,14 +42,12 @@ $obj->colors = array( | |||
53 | ); | 42 | ); |
54 | $obj->width = $width; | 43 | $obj->width = $width; |
55 | $obj->heigth = $heigth; | 44 | $obj->heigth = $heigth; |
56 | $obj->seconds = $seconds; | ||
57 | 45 | ||
58 | $obj->rrd_title = sprintf('CPU-%s usage', $pinstance); | 46 | $obj->rrd_title = sprintf('CPU-%s usage', $obj->args['pinstance']); |
59 | $obj->rrd_vertical = 'Jiffies'; | 47 | $obj->rrd_vertical = 'Jiffies'; |
60 | $obj->rrd_format = '%5.2lf'; | 48 | $obj->rrd_format = '%5.2lf'; |
61 | 49 | ||
62 | collectd_flush(ident_from_args($obj->args)); | 50 | collectd_flush($obj->identifiers); |
63 | |||
64 | $obj->rrd_graph(); | 51 | $obj->rrd_graph(); |
65 | 52 | ||
66 | ?> | 53 | ?> |