Re: [pmacct-discussion] The accounting of flows requires SQL table v4

2012-07-18 Thread Paolo Lucente
Hi Leonardo,

Solution to not get the error is to set sql_optimize_clauses to true
so to flag you are going to provide a custom table (which you do as
you provide a sql_table_schema) and disable versioning checks. It can
be an idea for the future (simple enough to code after all) to assume
sql_optimize_clauses is true if sql_table_schema is specified. 

Cheers,
Paolo 

On Mon, Jul 16, 2012 at 06:28:25PM -0300, Leonardo S?piras wrote:
  Hi everybody,
 
  I am trying to use the aggregate peer_src_ip in my pmacctd.conf. But when
 I start it the pmacct says: ERROR ( default/mysql ): The accounting of
 flows requires SQL table v4. Exiting.
 
  Without this directive, it works.
 
 Here my pmacctd.log:
 
 INFO ( default/mysql ): 110592 bytes are available to address shared memory
 segment; buffer size is 872 bytes.
 INFO ( default/mysql ): Trying to allocate a shared memory segment of
 24109056 bytes.
 INFO ( default/mysql ): sql_table_type set to 'bgp' (aggregate includes one
 or more BGP primitives).
 INFO ( default/memory ): 110592 bytes are available to address shared
 memory segment; buffer size is 872 bytes.
 INFO ( default/memory ): Trying to allocate a shared memory segment of
 24109056 bytes.
 ERROR ( default/mysql ): The accounting of flows requires SQL table v4.
 Exiting.
 INFO: connection lost to 'default-mysql'; closing connection.
 INFO ( default/core ): waiting for NetFlow data on :::5678
 OK ( default/memory ): waiting for data on: '/tmp/collect.pipe'
 OK: Exiting ..
 
 And my config:
 
 interface: eth0
 daemonize: true
 post_tag: 1
 aggregate: src_host, dst_host, src_port, dst_port, class, src_mac, dst_mac,
 tcpflags, proto, tos, flows, peer_src_ip
 classifiers: /etc/pmacct/classifiers/
 plugins: mysql, memory
 sql_db: database
 sql_table: acct_v8_%H%M
 sql_table_version: 8
 sql_user: yyy
 sql_passwd: xxx
 sql_table_schema: path to schema
 sql_refresh_time: 10
 sql_optimize_clauses: false
 sql_history: 1h
 sql_history_roundoff: mh
 !sql_preprocess: qnum=1000, minp=5
 !networks_file: ./networks.example
 !ports_file: ports.example
 !sampling_rate: 10
 !sql_trigger_time: 1h
 !sql_trigger_exec: /home/paolo/codes/hello.sh
 logfile: /var/log/pmacctd.log
 nfacctd_port: 5678
 
  My pmacct version is the pmacct-0.14.0rc3. What can I do to fix it?
 
  Thanks
 
 --
 Atenciosamente
 Leonardo Augusto S?piras

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


Re: [pmacct-discussion] The accounting of flows requires SQL table v4

2012-07-16 Thread Karl O. Pinc
On 07/16/2012 04:28:25 PM, Leonardo Sápiras wrote:
  Hi everybody,
 
  I am trying to use the aggregate peer_src_ip in my pmacctd.conf. But
 when
 I start it the pmacct says: ERROR ( default/mysql ): The accounting
 of
 flows requires SQL table v4. Exiting.
 
  Without this directive, it works.

The pmacct database tables that support pmacct have changed
over time.  There are different version numbers for different
table structures.  You need to re-create or update your
table structure in your db to something newer (at least v4)
in order to use peer_src_ip.

I can't help with the best way to do this but I seem
to recall instructions are included in the documentation.



Karl k...@meme.com
Free Software:  You don't pay back, you pay forward.
 -- Robert A. Heinlein


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


Re: [pmacct-discussion] The accounting of flows requires SQL table v4

2012-07-16 Thread Leonardo Sápiras
2012/7/16 Karl O. Pinc k...@meme.com

 On 07/16/2012 04:28:25 PM, Leonardo Sápiras wrote:
   Hi everybody,
 
   I am trying to use the aggregate peer_src_ip in my pmacctd.conf. But
  when
  I start it the pmacct says: ERROR ( default/mysql ): The accounting
  of
  flows requires SQL table v4. Exiting.
 
   Without this directive, it works.

 The pmacct database tables that support pmacct have changed
 over time.  There are different version numbers for different
 table structures.  You need to re-create or update your
 table structure in your db to something newer (at least v4)
 in order to use peer_src_ip.

 I can't help with the best way to do this but I seem
 to recall instructions are included in the documentation.


Thanks Karl, but it still looks weird. I found another discussion [1] a
little bit similar to it, IMHO. Are you sure that  it's not a bug? Or am I
missing anything in the pmacct config?


[1] - http://www.mail-archive.com/pmacct-discussion@pmacct.net/msg01455.html

Regards

--
Atenciosamente
Leonardo Augusto Sápiras
___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists

Re: [pmacct-discussion] The accounting of flows requires SQL table v4?

2010-02-08 Thread Paolo Lucente
Hi Zenon,

Good to see you around again. Please add to your config:

sql_table_version[sqltest]: 4

Reason being most of the primitives are still connected to the 
SQL table versioning concept (in essence: pmacct expects you to
make explicit which SQL schema you are running). This is in the
process of being dismantled, which is already the case with the
plethora of BGP-related primitives (i know you come from there
and hence it sounds new ...).

Cheers,
Paolo


On Mon, Feb 08, 2010 at 10:34:50AM +0200, Zenon Mousmoulas wrote:
 Hi,

 plugins: mysql[sqltest]
 sql_optimize_clauses[sqltest]: true
 sql_table[sqltest]: acct
 ...
 aggregate: src_as, [...] flows, tag

 I also tried

 aggregate[sqltest]: src_as, [...] flows, tag

 It is also in my schema:

 create table acct (
 id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
 agent_id INT(4) UNSIGNED NOT NULL,
 as_src INT(4) UNSIGNED NOT NULL,
   [...]
 flows INT UNSIGNED NOT NULL,
 packets INT UNSIGNED NOT NULL,
 bytes BIGINT UNSIGNED NOT NULL,
 stamp_inserted DATETIME NOT NULL,
 stamp_updated DATETIME,
 PRIMARY KEY (id),
 INDEX idxall (agent_id, as_src, as_dst, stamp_inserted)
 ) TYPE=MyISAM AUTO_INCREMENT=1;

 No matter what, I always get this:

 ERROR ( sqltest/mysql ): The accounting of flows requires SQL table v4. 
 Exiting.

 Using latest cvs code (2010-01-29).

 Any ideas?

 Thanks,
 Z.



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


Re: [pmacct-discussion] The accounting of flows requires SQL table v4?

2010-02-08 Thread Paolo Lucente
HI Zenon,

It turned to be a bug. It's now fixed and change is already
committed to the CVS. Please give it a try and let me know.

Cheers,
Paolo

On Mon, Feb 08, 2010 at 02:22:41PM +0200, Zenon Mousmoulas wrote:
 Hi Paolo,

 it's nice to be back :)

 I had already tried adding this directive (and tried it one more time  
 just before writing this). Unfortunately it made no difference...

 Z.

 On 08 ?? 2010, at 11:51 , Paolo Lucente wrote:

 Hi Zenon,

 Good to see you around again. Please add to your config:

 sql_table_version[sqltest]: 4

 Reason being most of the primitives are still connected to the
 SQL table versioning concept (in essence: pmacct expects you to
 make explicit which SQL schema you are running). This is in the
 process of being dismantled, which is already the case with the
 plethora of BGP-related primitives (i know you come from there
 and hence it sounds new ...).

 Cheers,
 Paolo


 On Mon, Feb 08, 2010 at 10:34:50AM +0200, Zenon Mousmoulas wrote:
 Hi,

 plugins: mysql[sqltest]
 sql_optimize_clauses[sqltest]: true
 sql_table[sqltest]: acct
 ...
 aggregate: src_as, [...] flows, tag

 I also tried

 aggregate[sqltest]: src_as, [...] flows, tag

 It is also in my schema:

 create table acct (
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
agent_id INT(4) UNSIGNED NOT NULL,
as_src INT(4) UNSIGNED NOT NULL,
 [...]
flows INT UNSIGNED NOT NULL,
packets INT UNSIGNED NOT NULL,
bytes BIGINT UNSIGNED NOT NULL,
stamp_inserted DATETIME NOT NULL,
stamp_updated DATETIME,
PRIMARY KEY (id),
INDEX idxall (agent_id, as_src, as_dst, stamp_inserted)
 ) TYPE=MyISAM AUTO_INCREMENT=1;

 No matter what, I always get this:

 ERROR ( sqltest/mysql ): The accounting of flows requires SQL table  
 v4.
 Exiting.

 Using latest cvs code (2010-01-29).

 Any ideas?

 Thanks,
 Z.



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


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