aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/interface.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugin/interface.php b/plugin/interface.php
index 6beee00..f200813 100644
--- a/plugin/interface.php
+++ b/plugin/interface.php
@@ -6,12 +6,17 @@ require_once 'conf/common.inc.php';
6require_once 'type/GenericIO.class.php'; 6require_once 'type/GenericIO.class.php';
7require_once 'inc/collectd.inc.php'; 7require_once 'inc/collectd.inc.php';
8 8
9# LAYOUT 9# LAYOUT - Collectd 4
10# interface/ 10# interface/
11# interface/if_errors-XXXX.rrd 11# interface/if_errors-XXXX.rrd
12# interface/if_octets-XXXX.rrd 12# interface/if_octets-XXXX.rrd
13# interface/if_packets-XXXX.rrd 13# interface/if_packets-XXXX.rrd
14 14
15# LAYOUT - Collectd 5
16# interface-XXXX/if_errors.rrd
17# interface-XXXX/if_octets.rrd
18# interface-XXXX/if_packets.rrd
19
15$obj = new Type_GenericIO($CONFIG); 20$obj = new Type_GenericIO($CONFIG);
16$obj->data_sources = array('rx', 'tx'); 21$obj->data_sources = array('rx', 'tx');
17$obj->ds_names = array( 22$obj->ds_names = array(
@@ -26,17 +31,18 @@ $obj->width = $width;
26$obj->heigth = $heigth; 31$obj->heigth = $heigth;
27$obj->rrd_format = '%5.1lf%s'; 32$obj->rrd_format = '%5.1lf%s';
28 33
34$instance = $CONFIG['version'] < 5 ? 'tinstance' : 'pinstance';
29switch($obj->args['type']) { 35switch($obj->args['type']) {
30 case 'if_errors': 36 case 'if_errors':
31 $obj->rrd_title = sprintf('Interface Errors (%s)', $obj->args['tinstance']); 37 $obj->rrd_title = sprintf('Interface Errors (%s)', $obj->args[$instance]);
32 $obj->rrd_vertical = 'Errors per second'; 38 $obj->rrd_vertical = 'Errors per second';
33 break; 39 break;
34 case 'if_octets': 40 case 'if_octets':
35 $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']); 41 $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args[$instance]);
36 $obj->rrd_vertical = 'Bytes per second'; 42 $obj->rrd_vertical = 'Bytes per second';
37 break; 43 break;
38 case 'if_packets': 44 case 'if_packets':
39 $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args['tinstance']); 45 $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args[$instance]);
40 $obj->rrd_vertical = 'Packets per second'; 46 $obj->rrd_vertical = 'Packets per second';
41 break; 47 break;
42} 48}