diff options
Diffstat (limited to 'plugin/iptables.php')
-rw-r--r-- | plugin/iptables.php | 32 |
1 files changed, 32 insertions, 0 deletions
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 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | require_once 'type/GenericStacked.class.php'; | ||
7 | require_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'); | ||
18 | switch($_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 | |||
29 | collectd_flush($obj->identifiers); | ||
30 | $obj->rrd_graph(); | ||
31 | |||
32 | ?> | ||