Добрый день всем! Я новичок так что просьба сразу не убивать а помучать...
Проблема в следующем хочу поставить и запустить ng_ipacct для сбора статистики и ни как не получается.
Действовал так:
Перво-наперво пересобрал ядро чтоб оно стало таким
.......
# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
options SCHED_4BSD # 4BSD scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
#options UFS_DIRHASH # Improve performance on big directories
options MD_ROOT # MD is a potential root device
options NFSCLIENT # Network Filesystem Client
options NFSSERVER # Network Filesystem Server
options NFS_ROOT # NFS usable as /, requires NFSCLIENT
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
#options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
options KTRACE # ktrace(1) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options ADAPTIVE_GIANT # Giant mutex is adaptive.
#--------------Firewall & NATD-----------
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=5
options IPDIVERT
#--------------BILLING-------------------
options NETGRAPH #netgraph(4) system
options NETGRAPH_ASYNC
options NETGRAPH_BPF
options NETGRAPH_CISCO
options NETGRAPH_ECHO
options NETGRAPH_ETHER
options NETGRAPH_FRAME_RELAY
options NETGRAPH_HOLE
options NETGRAPH_IFACE
options NETGRAPH_KSOCKET
options NETGRAPH_L2TP
options NETGRAPH_LMI
# MPPC compression requires proprietary files (not included)
#options NETGRAPH_MPPC_COMPRESSION
options NETGRAPH_MPPC_ENCRYPTION
options NETGRAPH_ONE2MANY
options NETGRAPH_PPP
options NETGRAPH_PPPOE
options NETGRAPH_PPTPGRE
options NETGRAPH_RFC1490
options NETGRAPH_SOCKET
options NETGRAPH_TEE
options NETGRAPH_TTY
options NETGRAPH_UI
options NETGRAPH_VJC
.....
потом установил ядро в систему перегрузилсо и поставил ng_ipacct из портов
cd /usr/ports/net-mgmt/ng_ipacct
make
install
после чего поправил стандартный конфиг ng_ipacct.conf заменил стандартный xl0 на rl0,
после этого
ipacctctl rl0_ipacct:rl0 checkpoint
ipacctctl rl0_ipacct:rl0 show
ipacctctl rl0_ipacct:rl0 clear
работало замечательно (/usr/local/etc/rc.d/ng_ipacct restart НЕ делал)
После этого решил проверить че будет если я перезагружусь (ну доэтого много раз ставил ng_ipacct и он не работал) и как я и боялся он перестал работать...
прочитал мануалы прочитал кучу статей не чего конкретного не нашел по этой проблеме.
потом конфиг уже аринтируясь на все прочитаное ng_ipacct.conf
ng_ipacct_rl0_dlt="EN10MB" # required line; see ipacctctl(8)
ng_ipacct_rl0_threshold="5000" # '5000' by default
ng_ipacct_rl0_verbose="yes" # 'yes' by default
ng_ipacct_rl0_saveuid="yes" # 'no' by default
ng_ipacct_rl0_savetime="yes" # 'no' by default
ng_ipacct_rl0_start=${ng_ipacct_default_ether_start}
ng_ipacct_rl0_stop=${ng_ipacct_default_ether_stop}
#ng_ipacct_rl0_checkpoint_script="path/to/your/script --checkpoint-and-save rl0"
# this script is called on stop (to save accumulated
# data) or via "rc.d/ng_ipacct.sh checkpoint"
Все что ниже первого примера удалил к дъяволу.
после перезагрузки
[root@router2 /]# ipacctctl rl0_ipacct:rl0 checkpoint
ipacctctl: ip_account_ctl: NgSendMsg: No such file or directory
ipacctctl: Cann't get version number from node
[root@router2 /]# ipacctctl rl0_ipacct:rl0 show
ipacctctl: ip_account_ctl: NgSendMsg: No such file or directory
ipacctctl: Cann't get version number from node
[root@router2 /]# ipacctctl rl0_ipacct:rl0 clear
ipacctctl: ip_account_ctl: NgSendMsg: No such file or directory
ipacctctl: Cann't get version number from node
пробую так
[root@router2 /]# /usr/local/etc/rc.d/ng_ipacct start
kldload: can't load netgraph: File exists
/usr/local/etc/rc.d/ng_ipacct: WARNING: can not load kld module netgraph
kldload: can't load ng_ether: File exists
/usr/local/etc/rc.d/ng_ipacct: WARNING: can not load kld module ng_ether
ngctl: send msg: File exists
ngctl: line 2: error in file
и еще вот
[root@router2 /]# kldstat
Id Refs Address Size Name
1 12 0xc0400000 37e8ac kernel
2 1 0xc077f000 59f20 acpi.ko
3 1 0xc12b0000 16000 linux.ko
4 1 0xc1371000 3000 ng_ipacct.ko
5 1 0xc13c4000 2000 accf_http.ko
6 1 0xc13ce000 3000 daemon_saver.ko
И вот главный вопрос в чем грабли ну вообще задолбался я с этим nng_ipacct...
пробовал другие считалки кроме ipcad не чего не понравилось, но собака такая как то не так считает трафик меньше показывает чем на самом деле...
Так что очень хочу ng_ipacct.