Andrey Koblyuk
2018-03-13 14:32:52 UTC
Hello!
my config
aggregate[storage] : src_host,dst_host,src_port,dst_port,proto,src_as,dst_as,in_iface,out_iface,timestamp_start,timestamp_end
sql_optimize_clauses[storage] : true
sql_table[storage] : traffic_%d%m%Y
sql_table_schema[storage] : /etc/pmacct/nfacct_schema.psql
sql_table_type[storage] : bgp
sql_dont_try_update[storage] : true
sql_use_copy[storage] : true
/etc/pmacct/nfacct_schema.psql:
CREATE TABLE traffic_%d%m%Y (
id_key BIGSERIAL PRIMARY KEY,
as_src BIGINT NOT NULL DEFAULT 0,
as_dst BIGINT NOT NULL DEFAULT 0,
ip_src inet NOT NULL DEFAULT '0.0.0.0',
ip_dst inet NOT NULL DEFAULT '0.0.0.0',
port_src INT NOT NULL DEFAULT 0,
port_dst INT NOT NULL DEFAULT 0,
ip_proto SMALLINT NOT NULL DEFAULT 0,
iface_in INT NOT NULL,
iface_out INT NOT NULL,
packets INT NOT NULL,
bytes BIGINT NOT NULL,
timestamp_start timestamp without time zone NOT NULL DEFAULT '0001-01-01 00:00:00',
timestamp_start_residual INT NOT NULL DEFAULT 0,
timestamp_end timestamp without time zone NOT NULL DEFAULT '0001-01-01 00:00:00',
timestamp_end_residual INT NOT NULL DEFAULT 0,
stamp_inserted timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP(0)
);
GRANT SELECT, INSERT, UPDATE, DELETE ON traffic_%d%m%Y TO pmacct;
1) first "purge" create table traffic_01011970, but current date 13032018. Why table create on 01011970?
2) next "purge" print this error in log
INFO ( storage/pgsql ): *** Purging cache - START (PID: 11285) ***
ERROR ( storage/pgsql ): ERROR: relation "traffic_01011970" already exists
INFO ( storage/pgsql ): *** Purging cache - END (PID: 11285, QN: 137084/137084, ET: 1) ***
Why does the table try to be recreated with each purge? what parameter is responsible for this?
my config
aggregate[storage] : src_host,dst_host,src_port,dst_port,proto,src_as,dst_as,in_iface,out_iface,timestamp_start,timestamp_end
sql_optimize_clauses[storage] : true
sql_table[storage] : traffic_%d%m%Y
sql_table_schema[storage] : /etc/pmacct/nfacct_schema.psql
sql_table_type[storage] : bgp
sql_dont_try_update[storage] : true
sql_use_copy[storage] : true
/etc/pmacct/nfacct_schema.psql:
CREATE TABLE traffic_%d%m%Y (
id_key BIGSERIAL PRIMARY KEY,
as_src BIGINT NOT NULL DEFAULT 0,
as_dst BIGINT NOT NULL DEFAULT 0,
ip_src inet NOT NULL DEFAULT '0.0.0.0',
ip_dst inet NOT NULL DEFAULT '0.0.0.0',
port_src INT NOT NULL DEFAULT 0,
port_dst INT NOT NULL DEFAULT 0,
ip_proto SMALLINT NOT NULL DEFAULT 0,
iface_in INT NOT NULL,
iface_out INT NOT NULL,
packets INT NOT NULL,
bytes BIGINT NOT NULL,
timestamp_start timestamp without time zone NOT NULL DEFAULT '0001-01-01 00:00:00',
timestamp_start_residual INT NOT NULL DEFAULT 0,
timestamp_end timestamp without time zone NOT NULL DEFAULT '0001-01-01 00:00:00',
timestamp_end_residual INT NOT NULL DEFAULT 0,
stamp_inserted timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP(0)
);
GRANT SELECT, INSERT, UPDATE, DELETE ON traffic_%d%m%Y TO pmacct;
1) first "purge" create table traffic_01011970, but current date 13032018. Why table create on 01011970?
2) next "purge" print this error in log
INFO ( storage/pgsql ): *** Purging cache - START (PID: 11285) ***
ERROR ( storage/pgsql ): ERROR: relation "traffic_01011970" already exists
INFO ( storage/pgsql ): *** Purging cache - END (PID: 11285, QN: 137084/137084, ET: 1) ***
Why does the table try to be recreated with each purge? what parameter is responsible for this?
--
ANK32-RIPE
ANK32-RIPE