See my previouse letter from 23 Apr 2008 with subject "best practice
(additional examples)". In this example i comment advantage of using
pmacct filters and agent_id field also (for nfprobe config).
# setting separate 'agent_id' for every observated network/zone and
# have advantage when use 'agent_id' for make requests from database so as:
# a) selects running quickly for compare number field then part of string
# (f.e. LEFT(ip_src,11))
# b) we can separate subnets by network bitmask (12.198.142.112/29) but
can't
# make such select from database (only by character string -
'12.198.142.')
>>> Here's the SQL query I use to get a nice listing of total data downloaded
>>> per month (June) by each IP:
>>>
>>> SELECT month( stamp_inserted), sum(bytes), ip_dst FROM acct_v2 where
>>> month(
>>> stamp_inserted) = 6 and ip_dst !='0.0.0.0' GROUP BY MONTH( stamp_inserted
>>> ),
>>> ip_dst order by sum(bytes);
>>>
>>
>> You don't use any filters (as i mention in my answer, SEE Enrico EXAMPLE
>> BELOW) and you will have any internal and external ip-addreses in ip_dst
>> field. Therefore you must specify in select clause expression for your
>> network. But better use pmacctd filters.
>>
>>
>
> Thanks for the reply. I am getting close to having pmacct working as
>needed.
> I know that I am not using pmacct filters, and that's the way I want it. I
> basically prefer to have all the magic in the SQL queries. I fail to
> understand why you think this is a bad approach, or why I should be using
> filters. I don't have to, do I ?
>
> The file specified with "networks_file: /etc/pmacct/pmacct-networks"
> specifies my internal networks, so all other Internet IPs will be stored
>in
> the DB as 0.0.0.0, so they won't really interfere with reporting. Please
>do
> let me know if you still think I must be using pmacct filters
>
> Thanks a million
> Regards
------
Так много можно сказать! Так мало нужно платить! Абоненты тарифных планов
'Свои люди' и 'Люблю поговорить' говорят внутри сети 'БеСТ' всего от
10 рублей за минуту разговора. Подробности на сайте http://www.best.by.
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists