Johannes Formann
Tue, 04 Aug 2009 17:41:13 -0700
Hello, I have a small problem with the current pmacct-Version, on every secound Insert into the databases I'll get the following message:
Aug 5 00:10:06 <host> pmacctd[21416]: ERROR ( inbound/mysql ): Duplicate entry
'2009-08-05 00:05:00-<someIP>' for key 1#012
Aug 5 00:10:11 <host> pmacctd[21417]: ERROR ( outbound/mysql ): Duplicate
entry '2009-08-05 00:05:00-0.0.0.0' for key 1#012
Aug 5 00:20:06 <host> pmacctd[22282]: ERROR ( inbound/mysql ): Duplicate entry
'2009-08-05 00:15:00-0.0.0.0' for key 1#012
Aug 5 00:20:11 <host> pmacctd[22283]: ERROR ( outbound/mysql ): Duplicate
entry '2009-08-05 00:15:00-<someOtherIP>' for key 1#012
Aug 5 00:30:06 <host> pmacctd[23150]: ERROR ( inbound/mysql ): Duplicate entry
'2009-08-05 00:25:00-0.0.0.0' for key 1#012
Aug 5 00:30:11 <host> pmacctd[23151]: ERROR ( outbound/mysql ): Duplicate
entry '2009-08-05 00:25:00-0.0.0.0' for key 1#012
The Configuration is quite simple I think:
! pmacctd configuration
!
!
daemonize: true
pidfile: /var/run/pmacctd.pid
syslog: daemon
!
! interested in in and outbound traffic
aggregate[inbound]: dst_host
aggregate[outbound]: src_host
plugins: mysql[inbound], mysql[outbound]
sql_table[inbound]: acct_%Y_%m_in
sql_table[outbound]: acct_%Y_%m_out
sql_table_schema[inbound]: /etc/pmacct/inbound.schema
sql_table_schema[outbound]: /etc/pmacct/outbound.schema
networks_file: /etc/pmacct/networks
! on this interface
interface: eth0
!
post_tag: 1
! storage methods
sql_db: pmacct
sql_table_version: 4
sql_passwd: <sorry, it's secret>
sql_user: pmacct
! refresh the db every 5 minute
sql_refresh_time: 300
! reduce the size of the insert/update clause
sql_optimize_clauses: true
! accumulate values in each row for up to 5 minutes
sql_history: 5m
! create new rows on the minute, hour, day boundaries
sql_history_roundoff: mhd
! Multivalue-Support, bei mysql schneller
sql_multi_values: 16000000
! viele Daten hier, mehr puffer
sql_cache_entries: 262168
! nur interessante Ports, reduktion der Datenmenge
ports_file: /etc/pmacct/ports
! nur inserts
sql_dont_try_update: true
! intern puffern
plugin_buffer_size: 40960
plugin_pipe_size: 40960000
! etwas die schreiblast verteilen
sql_startup_delay[inbound]: 5
sql_startup_delay[outbound]: 10
The schema are simple too (only the needed values):
# cat /etc/pmacct/inbound.schema
create table IF NOT EXISTS acct_%Y_%m_in (
ip_dst CHAR(15) NOT NULL,
packets INT UNSIGNED NOT NULL,
bytes BIGINT UNSIGNED NOT NULL,
stamp_inserted DATETIME NOT NULL,
stamp_updated DATETIME,
PRIMARY KEY (stamp_inserted, ip_dst)
);
# cat /etc/pmacct/outbound.schema
create table IF NOT EXISTS acct_%Y_%m_out (
ip_src CHAR(15) NOT NULL,
packets INT UNSIGNED NOT NULL,
bytes BIGINT UNSIGNED NOT NULL,
stamp_inserted DATETIME NOT NULL,
stamp_updated DATETIME,
PRIMARY KEY (stamp_inserted, ip_src)
);
Any Hints?
regards
Johannes
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists