aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/interface.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/interface.php')
-rw-r--r--plugin/interface.php48
1 files changed, 0 insertions, 48 deletions
diff --git a/plugin/interface.php b/plugin/interface.php
deleted file mode 100644
index 5728c07..0000000
--- a/plugin/interface.php
+++ /dev/null
@@ -1,48 +0,0 @@
1<?php
2
3# Collectd Interface plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/GenericIO.class.php';
7
8# LAYOUT - Collectd 4
9# interface/
10# interface/if_errors-XXXX.rrd
11# interface/if_octets-XXXX.rrd
12# interface/if_packets-XXXX.rrd
13
14# LAYOUT - Collectd 5
15# interface-XXXX/if_errors.rrd
16# interface-XXXX/if_octets.rrd
17# interface-XXXX/if_packets.rrd
18
19$obj = new Type_GenericIO($CONFIG, $_GET);
20$obj->data_sources = array('rx', 'tx');
21$obj->legend = array(
22 'rx' => 'Receive',
23 'tx' => 'Transmit',
24);
25$obj->colors = array(
26 'rx' => '0000ff',
27 'tx' => '00b000',
28);
29$obj->rrd_format = '%5.1lf%s';
30
31$instance = $CONFIG['version'] < 5 ? 'tinstance' : 'pinstance';
32switch($obj->args['type']) {
33 case 'if_errors':
34 $obj->rrd_title = sprintf('Interface Errors (%s)', $obj->args[$instance]);
35 $obj->rrd_vertical = 'Errors per second';
36 break;
37 case 'if_octets':
38 $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args[$instance]);
39 $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['network_datasize']));
40 $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1;
41 break;
42 case 'if_packets':
43 $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args[$instance]);
44 $obj->rrd_vertical = 'Packets per second';
45 break;
46}
47
48$obj->rrd_graph();