Hi,

I installed and tried to run pmacct. The steps I followed are:

1)./configure --enable-mysql

root@alfonso-K53SD:/home/alfonso/Descargas/pmacct-0.14.0# ./configure
--enable-mysql
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking OS... Linux
checking hardware... i686
checking for ranlib... (cached) ranlib
checking whether to enable debugging compiler options... no
checking whether to relax compiler optimizations... no
checking for gmake... (cached) make
checking whether make sets ${MAKE}... (cached) yes
checking for __progname... yes
checking for extra flags needed to export symbols... --export-dynamic
checking for static inline... yes
checking endianess... little
checking unaligned accesses... ok
checking whether to disable L2 features... no
checking whether to enable IPv6 code... no
checking default locations for pcap.h... found in /usr/local/include
checking default locations for libpcap... found in /usr/local/lib
checking for PF_RING library... no
checking for pcap_dispatch in -lpcap... (cached) yes
checking for pcap_setnonblock in -lpcap... (cached) yes
checking packet capture type... linux
checking whether to enable MySQL support... checking how to run the C
preprocessor... (cached) gcc -E
yes
checking default locations for libmysqlclient... found in /usr/lib/mysql
checking default locations for mysql.h... found in /usr/include/mysql
checking whether to enable PostgreSQL support... no
checking whether to enable SQLite3 support... no
checking whether to disable shared objects... no
checking for dlopen... (cached) no
checking for dlopen in -ldl... (cached) yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes
checking for getopt.h... (cached) yes
checking for sys/select.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for u_int64_t in sys/types.h... yes
checking for u_int32_t in sys/types.h... yes
checking for u_int16_t in sys/types.h... yes
checking for u_int8_t in sys/types.h... yes
checking for uint64_t in sys/types.h... no
checking for uint32_t in sys/types.h... no
checking for uint16_t in sys/types.h... no
checking for uint8_t in sys/types.h... no
checking whether to enable 64bit counters... no
checking whether to enable multithreading in pmacctd... no
checking whether to enable ULOG support... no
checking return type of signal handlers... (cached) void
checking for strlcpy... (cached) no
checking for vsnprintf... (cached) yes
checking for setproctitle... (cached) no

PLATFORM ..... : i686
OS ........... : Linux 3.0.0-21-generic (alfonso-K53SD)
COMPILER ..... : gcc
CFLAGS ....... : -O2 -g -O2  -I/usr/local/include
LIBS ......... : -lpcap  -L/usr/local/lib -L/usr/lib/mysql -lmysqlclient
-ldl -lm -lz -lnfprobe_plugin -Lnfprobe_plugin/ -lsfprobe_plugin
-Lsfprobe_plugin/ -lbgp -Lbgp/ -ltee_plugin -Ltee_plugin/ -lisis -Lisis/
LDFLAGS ...... : -Wl,--export-dynamic

Now type 'make' to compile the source code.

Are you willing to get in touch with other pmacct users?
Join the pmacct mailing-list by sending a message to
[email protected]

Need for documentation and examples?
Read the README file or go to http://wiki.pmacct.net/


creating ./config.status
creating Makefile
creating src/Makefile
creating src/nfprobe_plugin/Makefile
creating src/sfprobe_plugin/Makefile
creating src/bgp/Makefile
creating src/tee_plugin/Makefile
creating src/isis/Makefile

2)make

root@alfonso-K53SD:/home/alfonso/Descargas/pmacct-0.14.0# make
Making all in src
make[1]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src»
Making all in nfprobe_plugin
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/nfprobe_plugin»
make[2]: No se hace nada para «all».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/nfprobe_plugin»
Making all in sfprobe_plugin
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/sfprobe_plugin»
make[2]: No se hace nada para «all».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/sfprobe_plugin»
Making all in bgp
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/bgp»
make[2]: No se hace nada para «all».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/bgp»
Making all in tee_plugin
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/tee_plugin»
make[2]: No se hace nada para «all».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/tee_plugin»
Making all in isis
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/isis»
make[2]: No se hace nada para «all».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/isis»
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src»
make[2]: No se hace nada para «all-am».
make[2]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0/src»
make[1]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0/src»
make[1]: se ingresa al directorio «/home/alfonso/Descargas/pmacct-0.14.0»
make[1]: No se hace nada para «all-am».
make[1]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0»

3)make install

root@alfonso-K53SD:/home/alfonso/Descargas/pmacct-0.14.0# make install
Making install in src
make[1]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src»
Making install in nfprobe_plugin
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/nfprobe_plugin»
make[2]: No se hace nada para «install».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/nfprobe_plugin»
Making install in sfprobe_plugin
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/sfprobe_plugin»
make[2]: No se hace nada para «install».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/sfprobe_plugin»
Making install in bgp
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/bgp»
make[2]: No se hace nada para «install».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/bgp»
Making install in tee_plugin
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/tee_plugin»
make[2]: No se hace nada para «install».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/tee_plugin»
Making install in isis
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/isis»
make[2]: No se hace nada para «install».
make[2]: se sale del directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src/isis»
make[2]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src»
make[3]: se ingresa al directorio
«/home/alfonso/Descargas/pmacct-0.14.0/src»
/bin/sh ../mkinstalldirs /usr/local/bin
  /usr/bin/install -c  pmacct /usr/local/bin/pmacct
  /usr/bin/install -c  pmmyplay /usr/local/bin/pmmyplay
/bin/sh ../mkinstalldirs /usr/local/sbin
  /usr/bin/install -c  pmacctd /usr/local/sbin/pmacctd
  /usr/bin/install -c  nfacctd /usr/local/sbin/nfacctd
  /usr/bin/install -c  sfacctd /usr/local/sbin/sfacctd
  /usr/bin/install -c  uacctd /usr/local/sbin/uacctd
make[3]: No se hace nada para «install-data-am».
make[3]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0/src»
make[2]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0/src»
make[1]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0/src»
make[1]: se ingresa al directorio «/home/alfonso/Descargas/pmacct-0.14.0»
make[2]: se ingresa al directorio «/home/alfonso/Descargas/pmacct-0.14.0»
make[2]: No se hace nada para «install-exec-am».
make[2]: No se hace nada para «install-data-am».
make[2]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0»
make[1]: se sale del directorio «/home/alfonso/Descargas/pmacct-0.14.0»


When I run the program:

root@alfonso-K53SD:/home/alfonso/Descargas/pmacct-0.14.0# pmacct -s
INFO: Connection refused while trying to connect to '/tmp/'

.Why this error?

The daemon configuration file pmacctd is:

daemonize: true
pidfile: /var/run/pmacctd.pid
syslog: daemon

! There are now two MySQL plugins, one for storing data collected over
short time
! periods and one for collecting data over long time periods.
! They are labeled as short and long
! with the labels after the plugin names in square brackets e.g.
mysql[short]
! One is required for each table used. At the time of writing two plugins
are in use,
! and this number is assumed for the rest of the document
plugins: mysql[short], mysql[long]

! The aggregates, sql_table, sql_history, sql_history_roundoff and
sql_refresh_time values have been set up, one for each plugin
! They are associated with the plugin using labels, in the same manner as
they are used in the plugin declaration.
! E.g. aggregate[short]:
aggregate[short]: src_host, src_port, dst_host, dst_port, proto
aggregate[long]: src_host, src_port, dst_host, dst_port, proto
interface:wlan0

! Just log not local traffic
! May need to change for local network
pcap_filter: not (src and dst net 192.168.1.0/24)

sql_db: pmacct
sql_table[short]: acct_v6
! The acct_v6_long table needs to be created. This can be done with the
following query:
! create table if not exists acct_v6_long (ip_src CHAR(15) NOT NULL, ip_dst
CHAR(15) NOT NULL,  src_port INT(2) UNSIGNED NOT NULL,
! dst_port INT(2) UNSIGNED NOT NULL, ip_proto CHAR(6) NOT NULL, packets INT
UNSIGNED NOT NULL, bytes BIGINT UNSIGNED NOT NULL,
! flows INT UNSIGNED NOT NULL, stamp_inserted DATETIME NOT NULL,
stamp_updated DATETIME, PRIMARY KEY (ip_src, ip_dst, src_port, dst_port,
ip_proto, st$
sql_table[long]: acct_v6_long
! SQL history is one minute (1m) for the first plugin (short) and one
hour(1h) for the second (long)
sql_history[short]: 1m
sql_history[long]: 1h
! The readings are rounded to the nearest minute (m) for the first plugin
and the nearest hour (h) for the second
sql_history_roundoff[short]: m
sql_history_roundoff[long]: h
sql_table_version: 6
sql_host: root
sql_user: pmacct
sql_passwd: bluesky88
! The first plugin refresh data every 60 seconds, the second plugin every
3600 seconds,
! to match the timeperiods associated with that plugin in sql_history and
the roundoff
sql_refresh_time[short]: 60
sql_refresh_time[long]: 3600
sql_dont_try_update: true
sql_optimize_clauses: true

! Just log trafic highter than 1kb/min Set this value to a 1% of your
connection speed
sql_preprocess: minb = 1000

.And the table is generated in mysql:

mysql> use pmacct;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>
mysql>
mysql> show tables;
+------------------+
| Tables_in_pmacct |
+------------------+
| acct_v6          |
| acct_v6_long     |
+------------------+
2 rows in set (0.00 sec)

mysql>
mysql>
mysql> describe acct_v6;
+----------------+---------------------+------+-----+---------+-------+
| Field          | Type                | Null | Key | Default | Extra |
+----------------+---------------------+------+-----+---------+-------+
| agent_id       | int(4) unsigned     | NO   | PRI | NULL    |       |
| class_id       | char(16)            | NO   | PRI | NULL    |       |
| mac_src        | char(17)            | NO   | PRI | NULL    |       |
| mac_dst        | char(17)            | NO   | PRI | NULL    |       |
| vlan           | int(2) unsigned     | NO   | PRI | NULL    |       |
| as_src         | int(4) unsigned     | NO   | PRI | NULL    |       |
| as_dst         | int(4) unsigned     | NO   | PRI | NULL    |       |
| ip_src         | char(15)            | NO   | PRI | NULL    |       |
| ip_dst         | char(15)            | NO   | PRI | NULL    |       |
| src_port       | int(2) unsigned     | NO   | PRI | NULL    |       |
| dst_port       | int(2) unsigned     | NO   | PRI | NULL    |       |
| ip_proto       | char(6)             | NO   | PRI | NULL    |       |
| tos            | int(4) unsigned     | NO   | PRI | NULL    |       |
| packets        | int(10) unsigned    | NO   |     | NULL    |       |
| bytes          | bigint(20) unsigned | NO   |     | NULL    |       |
| flows          | int(10) unsigned    | NO   |     | NULL    |       |
| stamp_inserted | datetime            | NO   | PRI | NULL    |       |
| stamp_updated  | datetime            | YES  |     | NULL    |       |
+----------------+---------------------+------+-----+---------+-------+
18 rows in set (0.00 sec)


Thank you very much and sorry for the inconvenience.
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists

Reply via email to