diff options
Diffstat (limited to '')
-rw-r--r-- | plugin/apache.php | 24 | ||||
-rw-r--r-- | plugin/conntrack.php | 14 | ||||
-rw-r--r-- | plugin/contextswitch.php | 13 | ||||
-rw-r--r-- | plugin/entropy.php | 13 | ||||
-rw-r--r-- | plugin/users.php | 13 |
5 files changed, 48 insertions, 29 deletions
diff --git a/plugin/apache.php b/plugin/apache.php index 99fc689..95c12fa 100644 --- a/plugin/apache.php +++ b/plugin/apache.php | |||
@@ -19,10 +19,10 @@ switch ($obj->args['type']) { | |||
19 | case 'apache_bytes': | 19 | case 'apache_bytes': |
20 | $obj->data_sources = array('value'); | 20 | $obj->data_sources = array('value'); |
21 | $obj->ds_names = array( | 21 | $obj->ds_names = array( |
22 | $obj->args['type'] => 'Bytes/s', | 22 | 'value' => 'Bytes/s', |
23 | ); | 23 | ); |
24 | $obj->colors = array( | 24 | $obj->colors = array( |
25 | $obj->args['type'] => '0000ff', | 25 | 'value' => '0000ff', |
26 | ); | 26 | ); |
27 | $obj->rrd_title = sprintf('Webserver Traffic%s', | 27 | $obj->rrd_title = sprintf('Webserver Traffic%s', |
28 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); | 28 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); |
@@ -31,10 +31,10 @@ switch ($obj->args['type']) { | |||
31 | case 'apache_connections': | 31 | case 'apache_connections': |
32 | $obj->data_sources = array('value'); | 32 | $obj->data_sources = array('value'); |
33 | $obj->ds_names = array( | 33 | $obj->ds_names = array( |
34 | $obj->args['type'] => 'Conns/s', | 34 | 'value' => 'Conns/s', |
35 | ); | 35 | ); |
36 | $obj->colors = array( | 36 | $obj->colors = array( |
37 | $obj->args['type'] => '00b000', | 37 | 'value' => '00b000', |
38 | ); | 38 | ); |
39 | $obj->rrd_title = sprintf('Webserver Connections%s', | 39 | $obj->rrd_title = sprintf('Webserver Connections%s', |
40 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); | 40 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); |
@@ -43,10 +43,10 @@ switch ($obj->args['type']) { | |||
43 | case 'apache_idle_workers': | 43 | case 'apache_idle_workers': |
44 | $obj->data_sources = array('value'); | 44 | $obj->data_sources = array('value'); |
45 | $obj->ds_names = array( | 45 | $obj->ds_names = array( |
46 | $obj->args['type'] => 'Workers', | 46 | 'value' => 'Workers', |
47 | ); | 47 | ); |
48 | $obj->colors = array( | 48 | $obj->colors = array( |
49 | $obj->args['type'] => '0000ff', | 49 | 'value' => '0000ff', |
50 | ); | 50 | ); |
51 | $obj->rrd_title = sprintf('Webserver Idle Workers%s', | 51 | $obj->rrd_title = sprintf('Webserver Idle Workers%s', |
52 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); | 52 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); |
@@ -55,10 +55,10 @@ switch ($obj->args['type']) { | |||
55 | case 'apache_requests': | 55 | case 'apache_requests': |
56 | $obj->data_sources = array('value'); | 56 | $obj->data_sources = array('value'); |
57 | $obj->ds_names = array( | 57 | $obj->ds_names = array( |
58 | $obj->args['type'] => 'Requests/s', | 58 | 'value' => 'Requests/s', |
59 | ); | 59 | ); |
60 | $obj->colors = array( | 60 | $obj->colors = array( |
61 | $obj->args['type'] => '00b000', | 61 | 'value' => '00b000', |
62 | ); | 62 | ); |
63 | $obj->rrd_title = sprintf('Webserver Requests%s', | 63 | $obj->rrd_title = sprintf('Webserver Requests%s', |
64 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); | 64 | !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); |
@@ -157,12 +157,12 @@ $obj->rrd_format = '%5.1lf'; | |||
157 | if ($CONFIG['version'] < 5) { | 157 | if ($CONFIG['version'] < 5) { |
158 | $obj->data_sources = array('count'); | 158 | $obj->data_sources = array('count'); |
159 | if (count($obj->ds_names) == 1) { | 159 | if (count($obj->ds_names) == 1) { |
160 | $obj->ds_names['count'] = $obj->ds_names[$obj->args['type']]; | 160 | $obj->ds_names['count'] = $obj->ds_names['value']; |
161 | unset($obj->ds_names[$obj->args['type']]); | 161 | unset($obj->ds_names['value']); |
162 | } | 162 | } |
163 | if (count($obj->colors) == 1) { | 163 | if (count($obj->colors) == 1) { |
164 | $obj->colors['count'] = $obj->colors[$obj->args['type']]; | 164 | $obj->colors['count'] = $obj->colors['value']; |
165 | unset($obj->colors[$obj->args['type']]); | 165 | unset($obj->colors['value']); |
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
diff --git a/plugin/conntrack.php b/plugin/conntrack.php index 2034a57..6c38776 100644 --- a/plugin/conntrack.php +++ b/plugin/conntrack.php | |||
@@ -27,14 +27,12 @@ $obj->rrd_format = '%.1lf'; | |||
27 | # the data source is named 'entropy' in collectd's types.db | 27 | # the data source is named 'entropy' in collectd's types.db |
28 | if ($CONFIG['version'] < 5) { | 28 | if ($CONFIG['version'] < 5) { |
29 | $obj->data_sources = array('entropy'); | 29 | $obj->data_sources = array('entropy'); |
30 | if (count($obj->ds_names) == 1) { | 30 | |
31 | $obj->ds_names['entropy'] = $obj->ds_names['value']; | 31 | $obj->ds_names['entropy'] = $obj->ds_names['value']; |
32 | unset($obj->ds_names['value']); | 32 | unset($obj->ds_names['value']); |
33 | } | 33 | |
34 | if (count($obj->colors) == 1) { | 34 | $obj->colors['entropy'] = $obj->colors['value']; |
35 | $obj->colors['entropy'] = $obj->colors['value']; | 35 | unset($obj->colors['value']); |
36 | unset($obj->colors['value']); | ||
37 | } | ||
38 | } | 36 | } |
39 | 37 | ||
40 | collectd_flush($obj->identifiers); | 38 | collectd_flush($obj->identifiers); |
diff --git a/plugin/contextswitch.php b/plugin/contextswitch.php index 8a2036f..701a3a7 100644 --- a/plugin/contextswitch.php +++ b/plugin/contextswitch.php | |||
@@ -12,10 +12,10 @@ require_once 'inc/collectd.inc.php'; | |||
12 | $obj = new Type_Default($CONFIG); | 12 | $obj = new Type_Default($CONFIG); |
13 | $obj->data_sources = array('value'); | 13 | $obj->data_sources = array('value'); |
14 | $obj->ds_names = array( | 14 | $obj->ds_names = array( |
15 | 'contextswitches' => 'Context switches', | 15 | 'value' => 'Context switches', |
16 | ); | 16 | ); |
17 | $obj->colors = array( | 17 | $obj->colors = array( |
18 | 'contextswitches' => '0000f0', | 18 | 'value' => '0000f0', |
19 | ); | 19 | ); |
20 | $obj->width = $width; | 20 | $obj->width = $width; |
21 | $obj->heigth = $heigth; | 21 | $obj->heigth = $heigth; |
@@ -24,8 +24,15 @@ $obj->rrd_vertical = 'switch per second Bits'; | |||
24 | $obj->rrd_format = '%4.0lf'; | 24 | $obj->rrd_format = '%4.0lf'; |
25 | 25 | ||
26 | # backwards compatibility | 26 | # backwards compatibility |
27 | if ($CONFIG['version'] < 5) | 27 | if ($CONFIG['version'] < 5) { |
28 | $obj->data_sources = array('contextswitches'); | 28 | $obj->data_sources = array('contextswitches'); |
29 | 29 | ||
30 | $obj->ds_names['contextswitches'] = $obj->ds_names['value']; | ||
31 | unset($obj->ds_names['value']); | ||
32 | |||
33 | $obj->colors['contextswitches'] = $obj->colors['value']; | ||
34 | unset($obj->colors['value']); | ||
35 | } | ||
36 | |||
30 | collectd_flush($obj->identifiers); | 37 | collectd_flush($obj->identifiers); |
31 | $obj->rrd_graph(); | 38 | $obj->rrd_graph(); |
diff --git a/plugin/entropy.php b/plugin/entropy.php index bc7d308..bc1c95f 100644 --- a/plugin/entropy.php +++ b/plugin/entropy.php | |||
@@ -12,10 +12,10 @@ require_once 'inc/collectd.inc.php'; | |||
12 | $obj = new Type_Default($CONFIG); | 12 | $obj = new Type_Default($CONFIG); |
13 | $obj->data_sources = array('value'); | 13 | $obj->data_sources = array('value'); |
14 | $obj->ds_names = array( | 14 | $obj->ds_names = array( |
15 | 'entropy' => 'Entropy bits', | 15 | 'value' => 'Entropy bits', |
16 | ); | 16 | ); |
17 | $obj->colors = array( | 17 | $obj->colors = array( |
18 | 'entropy' => '0000f0', | 18 | 'value' => '0000f0', |
19 | ); | 19 | ); |
20 | $obj->width = $width; | 20 | $obj->width = $width; |
21 | $obj->heigth = $heigth; | 21 | $obj->heigth = $heigth; |
@@ -24,8 +24,15 @@ $obj->rrd_vertical = 'Bits'; | |||
24 | $obj->rrd_format = '%4.0lf'; | 24 | $obj->rrd_format = '%4.0lf'; |
25 | 25 | ||
26 | # backwards compatibility | 26 | # backwards compatibility |
27 | if ($CONFIG['version'] < 5) | 27 | if ($CONFIG['version'] < 5) { |
28 | $obj->data_sources = array('entropy'); | 28 | $obj->data_sources = array('entropy'); |
29 | 29 | ||
30 | $obj->ds_names['entropy'] = $obj->ds_names['value']; | ||
31 | unset($obj->ds_names['value']); | ||
32 | |||
33 | $obj->colors['entropy'] = $obj->colors['value']; | ||
34 | unset($obj->colors['value']); | ||
35 | } | ||
36 | |||
30 | collectd_flush($obj->identifiers); | 37 | collectd_flush($obj->identifiers); |
31 | $obj->rrd_graph(); | 38 | $obj->rrd_graph(); |
diff --git a/plugin/users.php b/plugin/users.php index a4558b5..a948fc1 100644 --- a/plugin/users.php +++ b/plugin/users.php | |||
@@ -12,10 +12,10 @@ require_once 'inc/collectd.inc.php'; | |||
12 | $obj = new Type_Default($CONFIG); | 12 | $obj = new Type_Default($CONFIG); |
13 | $obj->data_sources = array('value'); | 13 | $obj->data_sources = array('value'); |
14 | $obj->ds_names = array( | 14 | $obj->ds_names = array( |
15 | 'users' => 'Users', | 15 | 'value' => 'Users', |
16 | ); | 16 | ); |
17 | $obj->colors = array( | 17 | $obj->colors = array( |
18 | 'users' => '0000f0', | 18 | 'value' => '0000f0', |
19 | ); | 19 | ); |
20 | $obj->width = $width; | 20 | $obj->width = $width; |
21 | $obj->heigth = $heigth; | 21 | $obj->heigth = $heigth; |
@@ -24,8 +24,15 @@ $obj->rrd_vertical = 'Users'; | |||
24 | $obj->rrd_format = '%.1lf'; | 24 | $obj->rrd_format = '%.1lf'; |
25 | 25 | ||
26 | # backwards compatibility | 26 | # backwards compatibility |
27 | if ($CONFIG['version'] < 5) | 27 | if ($CONFIG['version'] < 5) { |
28 | $obj->data_sources = array('users'); | 28 | $obj->data_sources = array('users'); |
29 | 29 | ||
30 | $obj->ds_names['users'] = $obj->ds_names['value']; | ||
31 | unset($obj->ds_names['value']); | ||
32 | |||
33 | $obj->colors['users'] = $obj->colors['value']; | ||
34 | unset($obj->colors['value']); | ||
35 | } | ||
36 | |||
30 | collectd_flush($obj->identifiers); | 37 | collectd_flush($obj->identifiers); |
31 | $obj->rrd_graph(); | 38 | $obj->rrd_graph(); |