aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugin/ip6tables.php32
-rw-r--r--plugin/iptables.php32
2 files changed, 64 insertions, 0 deletions
diff --git a/plugin/ip6tables.php b/plugin/ip6tables.php
new file mode 100644
index 0000000..3f6c166
--- /dev/null
+++ b/plugin/ip6tables.php
@@ -0,0 +1,32 @@
1<?php
2
3# Collectd IPTables plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/GenericStacked.class.php';
7require_once 'inc/collectd.inc.php';
8
9## LAYOUT
10# ip6tables/ipt_bytes-XXX.rrd
11# ip6tables/ipt_packets-XXX.rrd
12
13$obj = new Type_GenericStacked($CONFIG);
14$obj->width = $width;
15$obj->heigth = $heigth;
16
17$obj->data_sources = array('value');
18switch($_GET['t']) {
19 case 'ipt_bytes':
20 $obj->rrd_title = 'Bytes';
21 break;
22 case 'ipt_packets':
23 $obj->rrd_title = 'Packets';
24 break;
25 }
26$obj->rrd_vertical = '';
27$obj->rrd_format = '%5.1lf%s';
28
29collectd_flush($obj->identifiers);
30$obj->rrd_graph();
31
32?>
diff --git a/plugin/iptables.php b/plugin/iptables.php
new file mode 100644
index 0000000..15a183b
--- /dev/null
+++ b/plugin/iptables.php
@@ -0,0 +1,32 @@
1<?php
2
3# Collectd IPTables plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/GenericStacked.class.php';
7require_once 'inc/collectd.inc.php';
8
9## LAYOUT
10# iptables/ipt_bytes-XXX.rrd
11# iptables/ipt_packets-XXX.rrd
12
13$obj = new Type_GenericStacked($CONFIG);
14$obj->width = $width;
15$obj->heigth = $heigth;
16
17$obj->data_sources = array('value');
18switch($_GET['t']) {
19 case 'ipt_bytes':
20 $obj->rrd_title = 'Bytes';
21 break;
22 case 'ipt_packets':
23 $obj->rrd_title = 'Packets';
24 break;
25 }
26$obj->rrd_vertical = '';
27$obj->rrd_format = '%5.1lf%s';
28
29collectd_flush($obj->identifiers);
30$obj->rrd_graph();
31
32?>