pmacct-discussion  

[pmacct-discussion] pmacct.conf for aggregated ip based accounting and vlan information

Falk Brockerhoff
Tue, 02 Aug 2011 02:56:03 -0700

Hi,

I have two core-switches each having a mirror port facing my pmacct server. I 
would like, what a surprise, to account all traffic to and from the servers 
behind my switches. Additional I would also like to save the vlan into the 
database, so that I'm able to get all traffic which belongs to a specific 
customer (which has a dedicated vlan).

My configuration (this one is for the first interface, eth4 - the second one, 
for eth5, is identical) looks like this:

--pmacct-eth4/5.conf--
daemonize: true
promisc: true
pidfile: /var/run/pmacctd.pid
syslog: daemon

interface: eth4/5

networks_file: /etc/pmacct/network
aggregate[all]: vlan,sum_host

plugins: mysql[all]

sql_host: localhost
sql_user: user
sql_passwd: secret
sql_db: database

sql_table_version: 2
sql_table: accounting_%Y_%m
sql_table_schema: /etc/pmacct/acct_v2-modified.schema

sql_refresh_time: 60
sql_optimize_clauses: true
sql_history: 5m
sql_history_roundoff: m

--acct_v2-modified.schema--
CREATE TABLE IF NOT EXISTS accounting_%Y_%m (
        agent_id INT(2) UNSIGNED NOT NULL,
        vlan INT(2) UNSIGNED NOT NULL,
        ip_src CHAR(15) NOT NULL,
        src_port INT(2) UNSIGNED NOT NULL,
        dst_port INT(2) UNSIGNED NOT NULL,
        packets INT UNSIGNED NOT NULL,
        bytes BIGINT UNSIGNED NOT NULL,
        stamp_inserted DATETIME NOT NULL,
        stamp_updated DATETIME,
        PRIMARY KEY (agent_id, vlan, ip_src, stamp_inserted),
        KEY vlan (vlan),
        KEY ip_src (ip_src),
        KEY stamp_updated (stamp_updated)
);

--network--
84.254.64.0/18

I have two problems and maybe you can help me:

1.) What have I to do, so that pmacct is logging the vlan id, too? Actually the 
value is always 0.

2.) Does this configuration match all incoming and outgoing traffic? Only the 
field ip_src is filled, ip_dst is left blank (so I removed it from the table). 
I'm not sure, if traffic in / from all directions is logged. In this first 
step, I only need information about traffic from / to ip addresses within my 
network.

Thank you in advance for your help!

Schönen Gruß aus Duisburg / Regards from Duisburg,

Falk Brockerhoff
smartTERRA Geschäftsführung / smartTERRA CEO

-- 
Kontaktmöglichkeiten / Postal Address, Contact:
smartTERRA GmbH, Postfach 170353, 47183 Duisburg
Telefon 0211-547 610 00, Telefax 0211-547 610 01
Meine Durchwahl / my phone: 0211-547 610 05

Sitz der Gesellschaft / Principal Office:
Vogelsanger Weg 91, 40470 Düsseldorf, Deutschland
GF Falk Brockerhoff, Amtsgericht Düsseldorf HR B 65811


_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists