Ahmed Kamal ha scritto:
Um, sorry one more basic question. My config is below (straight from examples), and the v2 table I have has a "bytes" column. I am not so sure if this bytes column is for download or upload or both. In my sql query I need to get the download and upload bytes per host IP address in last 30 days, a la

IP    DOWN    UP
1.2.3.4 <http://1.2.3.4>  600M 100M
5.6.7.8 <http://5.6.7.8>  800M  80M

Is it possible to get this info, from this config:

interface: eth1
daemonize: true
aggregate: src_host,dst_host
! aggregate: src_net,dst_net
! plugins: pgsql
plugins: mysql
sql_db: pmacct
sql_table: acct_v2
sql_table_version: 2
sql_passwd: xxxxx
sql_user: pmacct
sql_refresh_time: 90
! sql_optimize_clauses: true
sql_history: 10m
sql_history_roundoff: mh
! sql_preprocess: qnum=1000, minp=5
!
networks_file: /etc/pmacct/pmacct-networks


yes,

query  download:
SELECT sum( bytes )
FROM `table`
WHERE ip_dst = '1.2.3.4'

query  upload:
SELECT sum( bytes )
FROM `table`
WHERE ip_src = '1.2.3.4'

another way: mahe this changes in the script
!download
aggregate[in]: src_host, dst_host
aggregate_filter[in]: dst host 1.2.3.4

!upload
aggregate[out]: src_host, dst_host
aggregate_filter[out]: src host 1.2.3.4

!you need data per mounth
sql_history: 30m
sql_refresh_time: 300

then you can make a sum per column

byz

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

Reply via email to