IP Accounting: Difference between revisions
(document started) |
m (documentation was moved to github it seems.) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Draft}} | |||
This document will show how to configure [http://www.pmacct.net/ pmacct] for IP accounting. Pmacct will be configured as NetFlow and sFlow collector using PostgreSQL as DB backend. | This document will show how to configure [http://www.pmacct.net/ pmacct] for IP accounting. Pmacct will be configured as NetFlow and sFlow collector using PostgreSQL as DB backend. | ||
The following software have been used at the time of writing of this document: | |||
* pmacct-0.12.4-r3 | |||
* postgresql 8.4 | |||
== Install and Configure pmacct == | == Install and Configure pmacct == | ||
Line 8: | Line 14: | ||
postgres$ psql -d template1 -f pmacct-create-db.pgsql | postgres$ psql -d template1 -f pmacct-create-db.pgsql | ||
postgres$ psql -d pmacct -f pmacct-create- | postgres$ psql -d pmacct -f pmacct-create-table_v1.pgsql | ||
=== NetFlow Collector Daemon === | === NetFlow Collector Daemon === | ||
Line 17: | Line 23: | ||
pidfile: /var/run/nfacctd.pid | pidfile: /var/run/nfacctd.pid | ||
syslog: daemon | syslog: daemon | ||
sql_host: <HOSTNAME> | sql_host: <HOSTNAME> | ||
sql_passwd: <PASSWORD> | sql_passwd: <PASSWORD> | ||
sql_table_version: | sql_table_version: 1 | ||
plugins: pgsql | plugins: pgsql | ||
sql_optimize_clauses: true | sql_optimize_clauses: true | ||
sql_history: 1m | |||
sql_history: | sql_history_roundoff: m | ||
sql_history_roundoff: | |||
sql_dont_try_update: true | sql_dont_try_update: true | ||
aggregate: src_host,dst_host,src_port,dst_port,proto | |||
nfacctd_sql_log: true | |||
For explanation of the keywords above and full list of options supported by pmacct see [https://raw.githubusercontent.com/pmacct/pmacct/master/CONFIG-KEYS here]. | |||
[[Category:Networking]] | |||
[[Category:Monitoring]] | |||
[[Category:SQL]] |
Latest revision as of 01:17, 13 January 2022
This material is work-in-progress ... Do not follow instructions here until this notice is removed. |
This document will show how to configure pmacct for IP accounting. Pmacct will be configured as NetFlow and sFlow collector using PostgreSQL as DB backend.
The following software have been used at the time of writing of this document:
* pmacct-0.12.4-r3 * postgresql 8.4
Install and Configure pmacct
apk add pmacct pmacct-doc
On postgreSQL server launch the following scripts found in /usr/share/doc/pmacct/sql (make sure to change the default password for user "pmacct" in pmacct-create-db.pgsql):
postgres$ psql -d template1 -f pmacct-create-db.pgsql postgres$ psql -d pmacct -f pmacct-create-table_v1.pgsql
NetFlow Collector Daemon
Edit /etc/nfmacctd.conf, changing "<HOSTNAME>" and "<PASSWORD>" to correct values:
daemonize: true pidfile: /var/run/nfacctd.pid syslog: daemon sql_host: <HOSTNAME> sql_passwd: <PASSWORD> sql_table_version: 1 plugins: pgsql sql_optimize_clauses: true sql_history: 1m sql_history_roundoff: m sql_dont_try_update: true aggregate: src_host,dst_host,src_port,dst_port,proto nfacctd_sql_log: true
For explanation of the keywords above and full list of options supported by pmacct see here.