Sniffer upgrade

From VoIPmonitor.org
Revision as of 08:33, 17 April 2014 by Festr (talk | contribs)
Jump to navigation Jump to search

upgrade from web GUI

Go to settings -> sensors and do the upgrade from there.

upgrade to the latest versions (64bit)

#this is example for 9.4beta23 
wget download.voipmonitor.org/senzor/download/9.4beta23/voipmonitor.gz.64 (or 32 if you have 32bit)
mv voipmonitor.gz.64 voipmonitor.gz
gunzip voipmonitor.gz
chmod +x voipmonitor
killall -9 voipmonitor
mv voipmonitor /usr/local/sbin/
service voipmonitor start

Upgrade from 5.1

Since version 5.1 database is upgraded and populated automatically during first run (if mysql credential is set properly – CREATE and ALTER is needed).

Upgrade from 5.0 to 5.1

Upgrading database from 5.0 do not changes cdr table and thus the upgrade is instant. Here is the procedure Download voipmonitor sources and untar

wget https://sourceforge.net/projects/voipmonitor/files/5.1/voipmonitor-5.1-src.tar.gz/download

Go to voipmonitor source directory and run this command

cat cdrtable.sql.5.0-5.1 | mysql voipmonitor 

Where voipmonitor is name of the database. If you have password protected database, run

cat cdrtable.sql.5.0-5.1 | mysql -p voipmonitor 


Upgrade from 4.2 to 5.0

Database schema has changed in version 4 in way that it needs to alter table at least two times which is so inefficient that we had to write PHP script which transforms old CDR into new structure. On SATA disk upgrading 12 milions CDR takes ~24 hours which means that the table is also locked and no CDR is possible to write during the upgrade procedure. The procedure is:

#create new database 
mysqladmin create voipmonitor5
cat cdrtable.sql | mysql voipmonitor5
cd voipmonitor/scripts 
#edit mysql_copy_4.2to5.0.php and set appropriate constants: 
define("HOST", "localhost");
define("USER", "root");
define("PASS", "");
define("SOURCE_DB", "voipmonitor");
define("DEST_DB", "voipmonitor5");
#SOURCE_DB is the old database name, DEST_DB is the new database. 
  • Run the script php mysql_copy_4.2to5.0.php

The script can run for very long time so its recommended to run it from “screen” (apt-get install screen | yum install screen). The speed of conversion depends a lot on two factors - if binlog is enabled it is better to disable it in /etc/mysql/my.cn (comment out log_bin) in /etc/mysql/my.cnf set innodb_flush_log_at_trx_commit = 0 (and after you finish the upgrade, set it to = 2 (more secure) If disk is raid5 or slow SATA disk, insertion would be very slow. If the disk with mysql is shared with /var/spool/voipmonitor and voipmonitor sniffer is running - In this case stop mysql, mv /var/lib/mysql /mnt/dedicated/; mkdir /var/lib/mysql; chown mysql /var/lib/mysql; mount -o bind /mnt/dedicated/mysql /var/lib/mysql – and start mysql. After you finish export you can move all files back (do not forget to keep right permission on the files - user mysql).