pmacct-discussion  

Re: [pmacct-discussion] reloading config & accuracy

Paolo Lucente
Fri, 04 Sep 2009 14:47:03 -0700

Hi Tony,

On Wed, Sep 02, 2009 at 07:31:23PM -0700, Tony wrote:

> I have since discovered the existence of the "adjb" option for the 
> "sql_preprocess" config to account for the difference.
> 
> I am trying to use this to add the L2 (ethernet) overhead to see if the 
> figures match up more closely with this overhead included.
> 
> The problem I am having is that when I use this directive I am getting 
> nothing logged. The relevant config lines I have are:
> 
> aggregate[abc]: dst_host
> aggregate_filter[abc]: dst net x.x.x.x/21
> plugins: mysql[inbound], mysql[abc]
> sql_table[abc]: internet
> sql_preprocess[abc]: adjb=26
> 
> If I comment out the sql_preprocess line then the config works and I get 
> correct data being put into my SQL table. When I add the preprocess line I 
> get nothing being put into my table. Am I mis-understanding how to use this 
> option ?

The sql_preprocess directive supports both checks and actions;
a SQL entry must successfully pass a check in order to undergo
one of the available actions (adjb being one of those). In your
case you want a dummy check (ie. minp=1) to be put on the stack
in order for the action to be evaluated against every SQL entry
being committed to the database, ie.

sql_preprocess[abc]: minp=1, adjb=26

Can you give this a try? Perhaps this underlying mechanism is
not properly documented; it could be the trigger to change the
way it works: if no checks are specified, then evaluate the
specified action(s) against the entire queue of committed SQL
entries. 

Maybe there is still room for this in the upcoming 0.12.0rc2
release, let me see. Meanwhile, you should be able to see it
working right away the way described above. 

Cheers,
Paolo



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