aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorcisse@yahoo.fr2013-02-09 22:45:35 +0100
committerPim van den Berg2013-02-09 22:46:33 +0100
commit59a4afbbabff9eb7994ad82fef5005c2b1d28624 (patch)
tree37dc92d25f6ece86a8ae6e4a9b5f6f5df3c92073
parentinc/collectd.inc.php: remove . and .. from scandir before foreach (diff)
downloadapt-panopticon_cgp-59a4afbbabff9eb7994ad82fef5005c2b1d28624.zip
apt-panopticon_cgp-59a4afbbabff9eb7994ad82fef5005c2b1d28624.tar.gz
apt-panopticon_cgp-59a4afbbabff9eb7994ad82fef5005c2b1d28624.tar.bz2
apt-panopticon_cgp-59a4afbbabff9eb7994ad82fef5005c2b1d28624.tar.xz
plugin: add iptables/ip6tables plugin
Signed-off-by: Manuel CISSÉ <manuel_cisse@yahoo.fr>
-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?>