Linux /etc/voipmonitor.conf 例子

本文提供了一个Linux系统中voipmonitor配置文件`/etc/voipmonitor.conf`的示例,并讨论了voipmonitor进程如何占用大量CPU资源,尤其关注其对MySQL数据库的影响和运维开发中的考量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#
# voipmonitor.org configuration file
#
# location of this file is at ~/.voipmonitor.conf or /etc/voipmonitor.conf
# command line parameters overrides configuration directives in this file
# allowed comments are ; or #.
#

[general]

# in case of running more voipmonitor instances on the same or another servers configured to save to one database
and the same cdr table
# it is possible to differentiate CDR by id_sensor column. If you set id_sensor >= 0 the number will be saved in c
dr.id_sensor column.
# The number is between 1 - 65535 (16bit number)

id_sensor = 22


################## START DATABASE CONFIGURATION ###############

# SQL driver - mysql is default or odbc (connecting voipmonitor to msssql please refer to README.mssql
sqldriver = mysql
#sqldriver = odbc
#odbcdriver = mssql
#odbsdsn = voipmonitor
#odbcuser = root
#odbcpass =

# mysql server can be IP or hostname
mysqlhost = 127.0.0.1
mysqlport = 3306
mysqlusername = voipmonitor
mysqlpassword = voipmonitor

# mysql database - will be created automatically if it does not exists
mysqldb = voipmonitor

# use partitioning cdr* tables by day. If you have schema without partitioning, you MUST start with new database.
default is = yes
cdr_partition = no

# mysql table compression (default enabled)
mysqlcompress = no

# load configuration from database - (from table sensor_conf) by id_sensor (SELECT * FROM sensor_conf WHERE id_sen
sor = N)
# if you do not set id_sensor and mysqlloadconfig is enabled it will load first row in database with id_sensor IS
NULL
# configuration in this file is loaded FIRST then is OVERWRITEN by settings in MySQL!
# if this configuration option is not set default is enabled
mysqlloadconfig = no

# disable partition creation which runs every 12 hours. If you have multiple sensors storing to one database it is
 redundant to create partitions by all sensors. Default = no
disable_partition_operations = yes

# In case you need to create partitions back to 90 days for example use this option. This is useful when you want
to migrate data. This will create partitions only if table does not exists
#create_old_partitions = yes | no

# if you do not want to save cdr.callend = calldate + duration for some reason (you do not want to upgrade cdr, se
t it to no). Default is yes
sqlcallend = yes


###########  END DATABAE CONFIGURATION #################

# voipmonitor is able to sniff directly on network interface or it can read files.

# listening interface. Can be 'any' which will listen on all interfaces - NOTE that "any" will not put interfaces
into promiscuous mode
# and you have to do it with "ifconfig eth0 promisc"
# you can also sniff on multiple interfaces by providing list of them delimited by ',' example: interface = eth0,e
th1

#interface = eth0,eth1
#interface = any

interface = em3

# default threading_mod = 1 uses one thread for reading from interface doing deduplication at once
# threading_mod = 2 (which is automatically set if you have multiple interfaces (interface = eth0,eth1,...) reads
from each interface
# in separate thread which is better option on multi core systems than interface = any
# threading_mod = 3 will do deduplication (if enabled) in separate thread which is needed for high traffic
# threading_mod = 4 will do deduplication in more than one threads - use this option if you enable deduplication a
nd your traffic is over 100Mbit

#threading_mod = 1

# since version 8 sniffer implements new mirroring option. Sender is packing data to compressed stream over the
# TCP to remote sniffer.
# if you are going to use this sniffer only as a mirroring sniffer all you need is to set interface, packetbuffer_
*
# set compression on and set packetbuffer_file_* so in case the connection to remote sniffer will die or will be
# temporarily slow the sender will not loose single packet. The mirroring is trying to reconnect in case of
# failure. Packets are mirrored including the the original timestamp and headers.
# this mirroring hopefully replaces pcapscandir feature which will be probably removed in favor of this approach.

# here set the sending (mirroring). The sender needs to set only interface, ringbuffer, packetbuffer_*, filter
# and this two folling mirror_destination_*
#mirror_destination_ip          =
#mirror_destination_port        =

# here set the receiver and do not forget to set firewall so no other except the sender will be able to connect
# to the receiver
#mirror_bind_ip               =
#mirror_bind_port             =
#mirror_bind_dlt              = 1       // DLT_EN10MB Ethernet (10Mb)


server_destination = 11.22.33.44
server_destination_port = 55044
server_password = hide

# scan pcap files folder and read file by file. This is in conjuction with running tcpdump which creates pcap file
 each
# 5 seconds (-G 5) storing pcap files named by UNIX_TIMESTAMP to /dev/shm/voipmonitor folder (do not forget create
 it)
# using 1GB ring buffer to avoid losing packets (-B500000 - you can lower it but not higher) filtering udp packets
 (udp
# parameter whcih you can change to your needs). voipmonitor then reads created files (and delete it after process
ing.
# This approach can be used for testing throughput or for very high voip traffic (>500Mbit). If the sniffer is abl
e to
# process pcap files in realtime - there will be in /dev/shm/voipmonitor folder only one or two pcap files. If the
 sniffer
# is not able to process in realtime (blocking by I/O or by CPU) number of pcap files will grow faster then the sn
iffer
# is able process.

# WARNING: libpcap < 1.1 contains memory leak when pcap filter is set - do not set filter in this config or upgrad
e libpcap to the latest (debian 6 libpcap contains the leak)
# static compiled voipmonitor from voipmonitor.org contains the latest libpcap
#
# tcpdump example command:
# nice -n -20 tcpdump -B500000 -i eth2 udp -G 5 -w /dev/shm/voipmonitor 2>/dev/null 1>/dev/null &
#scanpcapdir = /dev/shm/voipmonitor

# When scanpcapdir is being used, voipmonitor will by default 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值