aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/iptables.php
blob: 8e5fa895345b422ace2524d56765b1c720929a9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

# Collectd IPTables plugin

require_once 'conf/common.inc.php';
require_once 'type/GenericStacked.class.php';
require_once 'inc/collectd.inc.php';

## LAYOUT
# iptables/ipt_bytes-XXX.rrd
# iptables/ipt_packets-XXX.rrd

$obj = new Type_GenericStacked($CONFIG);
$obj->width = $width;
$obj->heigth = $heigth;

$obj->data_sources = array('value');
switch($_GET['t']) {
	case 'ipt_bytes':
	  $obj->rrd_title = 'Bytes';
	  break;
	case 'ipt_packets':
	  $obj->rrd_title = 'Packets';
	  break;
 }
$obj->rrd_vertical = '';
$obj->rrd_format = '%5.1lf%s';

collectd_flush($obj->identifiers);
$obj->rrd_graph();