The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  вход/выход  слежка  RSS
"netacct-mysql-0.78 не пишет в базу данных"
Вариант для распечатки  
Пред. тема | След. тема 
Форум Настройка Squid и других прокси серверов (Учет работы пользователей, логи)
Изначальное сообщение [ Отслеживать ]

"netacct-mysql-0.78 не пишет в базу данных"  +/
Сообщение от leks_smile email on 14-Фев-13, 05:27 
установил сабж, настроил конфиг под свою сетку, настроил пользователя и права доступа к БД, но он не пишет ничего в mysql

лог мускуля:
/usr/local/libexec/mysqld, Version: 5.0.95-log (FreeBSD port: mysql-server-5.0.95). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
130213 16:41:06          1 Connect     Access denied for user 'root'@'localhost' (using password: NO)
130213 16:42:14          2 Connect     acct@localhost on netacct
130213 16:42:44          3 Connect     acct@localhost on netacct
130213 16:43:15          4 Connect     acct@localhost on netacct
130213 16:43:40          5 Connect     acct@localhost on netacct

по логу можем видеть, что прога цепляется к серверу под своей учеткой, но в phpmyadmin видно, что растет счетчик сброшенных коннектов: http://s57.radikal.ru/i156/1302/66/6de189c49ded.png (4 коннекта в логе = 4 aborted connection в phpmyadmin)

демон запускается без ошибок конфига (/var/log/debug.log):

Code:
---------
Feb 13 14:55:25 mail nacctd: config: sniff set to 0
Feb 13 14:55:25 mail nacctd: config: pid_file set to /var/run/nacctd.pid
Feb 13 14:55:25 mail nacctd: config: set flushing to 30
Feb 13 14:55:25 mail nacctd: config: set delay on error to 1
Feb 13 14:55:25 mail nacctd: config: set fdelay to 60
Feb 13 14:55:25 mail nacctd: config: added listen device msk0
Feb 13 14:55:25 mail nacctd: config: added listen device tun0
Feb 13 14:55:25 mail nacctd: config: added listen device msk1
Feb 13 14:55:25 mail nacctd: config: set ignoremask 255.255.255.0
Feb 13 14:55:25 mail nacctd: config: added headerinfo (lo:14:12)
Feb 13 14:55:25 mail nacctd: config: added headerinfo (eth:14:12)
Feb 13 14:55:25 mail nacctd: config: added headerinfo (ppp:14:12)
Feb 13 14:55:25 mail nacctd: config: debug level 5
Feb 13 14:55:25 mail nacctd: config: set debug to /tmp/nacctd.debug
Feb 13 16:42:13 mail nacctd: config: sniff set to 0
Feb 13 16:42:13 mail nacctd: config: mysql_user = acct
Feb 13 16:42:13 mail nacctd: config: password ok!
Feb 13 16:42:13 mail nacctd: config: mysql_host = localhost
Feb 13 16:42:13 mail nacctd: config: mysql_port = 0
Feb 13 16:42:13 mail nacctd: config: mysql DB = netacct
Feb 13 16:42:13 mail nacctd: config: pid_file set to /var/run/nacctd.pid
Feb 13 16:42:13 mail nacctd: config: set flushing to 30
Feb 13 16:42:13 mail nacctd: config: set delay on error to 1
Feb 13 16:42:13 mail nacctd: config: set fdelay to 60
Feb 13 16:42:13 mail nacctd: config: added listen device msk0
Feb 13 16:42:13 mail nacctd: config: added listen device tun0
Feb 13 16:42:13 mail nacctd: config: added listen device msk1
Feb 13 16:42:13 mail nacctd: config: set ignoremask 255.255.255.0
Feb 13 16:42:13 mail nacctd: config: added headerinfo (lo:14:12)
Feb 13 16:42:13 mail nacctd: config: added headerinfo (eth:14:12)
Feb 13 16:42:13 mail nacctd: config: added headerinfo (ppp:14:12)
Feb 13 16:42:13 mail nacctd: config: debug level 5
Feb 13 16:42:13 mail nacctd: config: set debug to /tmp/nacctd.debug
Feb 13 16:42:14 mail nacctd: clear_counters() called
Feb 13 16:42:44 mail nacctd: clear_counters() called
---------

судя по родному debug-файлу netacct'a, с перехватом пакетов тоже все в порядке(/tmp/nacctd.debug):
Code:
---------
*CUT*
13/02 16:42:14 [STATE] analyzis for src 192.168.3.129, dst 87.250.250.203, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 111.221.77.157, dst 192.168.3.69, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.69, dst 94.245.121.251, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 87.250.250.203, dst 192.168.3.129, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 94.245.121.251, dst 192.168.3.69, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.200, dst 111.111.111.111, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 111.111.111.111, dst 192.168.3.200, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.200, dst 111.111.111.111, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 195.239.111.11, dst 192.168.3.129, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.129, dst 195.239.111.11, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.200, dst 111.111.111.111, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 111.111.111.111, dst 192.168.3.200, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 195.239.111.11, dst 192.168.3.203, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.203, dst 195.239.111.11, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] write_log called
13/02 16:42:14 [STATE] lck = 1
13/02 16:42:14 [STATE] lck = 0
13/02 16:42:14 [STATE] write child: synchronized with parent
13/02 16:42:14 [STATE] parent: synchronized with write child
13/02 16:42:14 [STATE] * write process 78116 forked
13/02 16:42:14 [STATE] writepid is 78116
13/02 16:42:14 [STATE] done freeing
13/02 16:42:14 [STATE] -> got signal 20, handling
13/02 16:42:14 [STATE] set writing to 0, ignored return code
13/02 16:42:14 [STATE] child 78116 signaled return
13/02 16:42:14 [STATE] <- got signal 20, done handling
13/02 16:42:16 [STATE] analyzis for src 192.168.3.182, dst 111.221.74.31, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.129, dst 87.250.250.203, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 87.250.250.203, dst 192.168.3.129, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 111.221.74.31, dst 192.168.3.182, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.229, dst 217.69.141.226, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 217.69.141.226, dst 192.168.3.229, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.138, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.138, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.138, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 195.239.111.6, dst 192.168.3.132, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.132, dst 195.239.111.6, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
*CUT*
---------

никаких ошибок касательно mysql в логах не появляется...

есть какие-нибудь идеи, что я сделал неправильно? куда копать?

Ответить | Правка | Cообщить модератору

Оглавление

Сообщения по теме [Сортировка по времени | RSS]


1. "netacct-mysql-0.78 не пишет в базу данных"  +/
Сообщение от vg (??) on 14-Фев-13, 11:12 
база создана?
mysql пользователь имеет доступ к базе?
по какой таблице смотрели?
Ответить | Правка | ^ к родителю #0 | Наверх | Cообщить модератору

2. "netacct-mysql-0.78 не пишет в базу данных"  +/
Сообщение от vg (??) on 14-Фев-13, 11:15 
да, это выполнили?
Run the "netacct.sql" script: "mysql -u root -p <netacct.sql"
Ответить | Правка | ^ к родителю #1 | Наверх | Cообщить модератору

3. "netacct-mysql-0.78 не пишет в базу данных"  +/
Сообщение от leks_smile email on 15-Фев-13, 03:25 
> база создана?

да, конечно(ее даже видно на скриншоте в списке слева).

> Run the "netacct.sql" script: "mysql -u root -p <netacct.sql"

как раз этот sql-файл  и базу создает, и пользователя acct@localhost и дает ему доступ к БД netacct.
после скрипта на всякий случай сделал grant ALL priveleges для пользователя acct.

> mysql пользователь имеет доступ к базе?

как проверить? при установке mysql-server из портов вроде пользователь создается автоматически и доступ ему тоже дается во время выполнения make install.

> по какой таблице смотрели?

что именно? количество сброшенных соединений? в phpmyadmin есть раздел "состояние"(server_status.php). у меня таймер записи в БД в конфиге netacct стоит 30 секунд, как раз с таким интервалом и растет счетчик.

компиляция происходит без ошибок вроде
CODE
---
[8:16:58](0)/home/eugene/netacct-mysql-0.78# ./configure --with-mysql
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking utmp.h usability... yes
checking utmp.h presence... yes
checking for utmp.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking for working volatile... yes
checking for unistd.h... (cached) yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for function prototypes... yes
checking whether setvbuf arguments are reversed... no
checking return type of signal handlers... void
checking for strftime... yes
checking for alarm... yes
checking for memmove... yes
checking for putenv... yes
checking for select... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... yes
checking for strerror... yes
checking for strtol... yes
checking build system type... amd64-unknown-freebsd8.2
checking host system type... amd64-unknown-freebsd8.2
checking for pcap_dispatch in -lpcap... yes
checking "for mysql"... yes
checking for compress in -lz... yes
checking "for oracle home"... ""
checking "for oracle pro*c"... no
checking for library containing pthread_create... none required
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

[8:17:20](0)/home/eugene/netacct-mysql-0.78# make && make install
make  all-recursive
Making all in src
Making install in src
/bin/sh ../mkinstalldirs /usr/local/sbin
  /usr/bin/install -c nacctd /usr/local/sbin/nacctd
if [ ! -f /usr/local/etc/naccttab ]; then  /bin/sh ../mkinstalldirs /usr/local/etc;  /usr/bin/install -c -m 644 ./naccttab.sample /usr/local/etc/naccttab;  /usr/bin/install -c -m 644 ./nacctpeering /usr/local/etc/nacctpeering;  fi
/bin/sh ../mkinstalldirs /usr/local/man/man8
/usr/bin/install -c -m 644 ./nacctd.8 /usr/local/man/man8/nacctd.8
/usr/bin/install -c -m 644 ./nacctpeering.8 /usr/local/man/man8/nacctpeering.8

/usr/bin/install -c -m 644 ./nacctpeering.8 /usr/local/man/man8/nacctpeering.8
---


но как-то ловил такие warning-и:
CODE
---
(0)/home/eugene/netacct-mysql-0.78# make install
process.c: In function 'do_write_list':
process.c:258: warning: cast to pointer from integer of different size
process.c:262: warning: cast to pointer from integer of different size
daemon.c: In function 'daemon_stop':
daemon.c:44: warning: incompatible implicit declaration of built-in function 'strcpy'
daemon.c:46: warning: incompatible implicit declaration of built-in function 'strcpy'
daemon.c:48: warning: incompatible implicit declaration of built-in function 'strcpy'
daemon.c:50: warning: incompatible implicit declaration of built-in function 'strcpy'
daemon.c:53: warning: incompatible implicit declaration of built-in function 'strcpy'
daemon.c:55: warning: incompatible implicit declaration of built-in function 'strcpy'
mysql.c: In function 'write_mysql':
mysql.c:66: warning: incompatible implicit declaration of built-in function 'strncpy'
mysql.c:124: warning: incompatible implicit declaration of built-in function 'strcpy'
mysql.c: In function 'do_write_list_mysql':
mysql.c:152: warning: cast to pointer from integer of different size
mysql.c:164: warning: cast to pointer from integer of different size
---

Ответить | Правка | ^ к родителю #1 | Наверх | Cообщить модератору

Архив | Удалить

Рекомендовать для помещения в FAQ | Индекс форумов | Темы | Пред. тема | След. тема




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру