Sniffer upgrade: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= upgrade to the latest snapshot versions (64bit)=
= Upgrade or Downgrade from web GUI =
Go to settings -> sensors and do the upgrade from there.
Only running sniffers can be downgraded or upgraded via GUI. If you need to do downgrade, click on (+) for details, and then click on Blue UPGRADE button, dropbox will appear with versions available for downgrade/upgrade.


#warning - this is only for 64bit version
killall -9 voipmonitor
cd /usr/local/sbin
rm voipmonitor
wget http://www.voipmonitor.org/downloads/snapshots/current/voipmonitor
chmod +x voipmonitor
/etc/init.d/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 =
= Manual upgrade or downgrade =
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
== Stop running sniffer service ==
Go to voipmonitor source directory and run this command
 
  cat cdrtable.sql.5.0-5.1 | mysql voipmonitor  
/etc/init.d/voipmonitor stop
Where voipmonitor is name of the database. If you have password protected database, run
# In case that service won't stop, press CTRL+C and use KILL signal to terminate the process with a force:
  cat cdrtable.sql.5.0-5.1 | mysql -p voipmonitor  
kill -9 `pgrep voipmonitor`
# In case that multiple instances of voipmonitor are running there, use last command multiple-times.
 
== Choose a package version on a sourceforge site ==
 
Find voipmonitor*.tar.gz file of your choice at site https://sourceforge.net/projects/voipmonitor/files/ and use the link for wget command in step by step [https://wiki.voipmonitor.org/doc/index.php?title=Sniffer_installation&action=submit#Step_by_step_for_64bit_linux_procedure How To Install Sniffer]
 
=== Example of wget command for version 20.4.4 with ss7(wireshark) module ===
  wget https://sourceforge.net/projects/voipmonitor/files/20.4/voipmonitor-wireshark-amd64-20.4.4-static.tar.gz/download -O voipmonitor-wireshark-amd64-20.4.4-static.tar.gz --content-disposition --no-check-certificate
 
 
== Download just a binary file directly from voipmonitor ==
 
Beware that only few latest versions are available
 
=== Example link for 32bit version of 20.4.4 sniffer binary ===
 
http://download.voipmonitor.org/senzor/download/20.4.4/voipmonitor.gz.32
 
=== Example link for 64bit version of 20.4.4 sniffer binary ===
 
  http://download.voipmonitor.org/senzor/download/20.4.4/voipmonitor.gz.64
 
=== Example link for ArmV6(RPI) and SS7(wireshark) sniffer bianaries ===
 
Curently those binaries are not available directly - use steps for installing voipmonitor package from a [https://wiki.voipmonitor.org/doc/index.php?title=Sniffer_upgrade&action=submit#Choose_package_version_on_a_sourceforge_site sourceforge] above to download whole package and steps to install sniffer.
 
=== step by step for upgrade using downloaded binary file for 64bit ===
#You can backup previous version of a sniffer
mv /usr/local/sbin/voipmonitor /usr/local/sbin/voipmonitor-backup
#Download gziped binary, rename it and unpack.
  wget http://download.voipmonitor.org/senzor/download/20.4.4/voipmonitor.gz.64 --content-disposition --no-check-certificate
mv voipmonitor.gz.64 voipmonitor.gz
gunzip -c voipmonitor.gz > /usr/local/sbin/voipmonitor


#Ensure file is executable
chmod +x /usr/local/sbin/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:
= Manual upgrade to develop version =
#create new database
[[Sniffer_installation#Newest_static_versions_from_develop_branch]]
mysqladmin create voipmonitor5
cat cdrtable.sql | mysql voipmonitor5
cd voipmonitor/scripts


#edit mysql_copy_4.2to5.0.php and set appropriate constants:
= Check installed version =
define("HOST", "localhost");
== Locally using binary ==
  define("USER", "root");
  voipmonitor|head
define("PASS", "");
== Remotely using manager API of a running sniffer ==
  define("SOURCE_DB", "voipmonitor");
  echo 'sniffer_version'|nc 127.0.0.1 5029
define("DEST_DB", "voipmonitor5");
where 127.0.0.1 is IP of a 'managerip' and 5029 is 'managerport' defined in this sniffer's config
#SOURCE_DB is the old database name, DEST_DB is the new database.


*Run the script  php mysql_copy_4.2to5.0.php
= Start installed version =
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)
  /etc/init.d/voipmonitor start
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).
#or
service voipmonitor start

Latest revision as of 13:19, 2 September 2020

Upgrade or Downgrade from web GUI

Go to settings -> sensors and do the upgrade from there. Only running sniffers can be downgraded or upgraded via GUI. If you need to do downgrade, click on (+) for details, and then click on Blue UPGRADE button, dropbox will appear with versions available for downgrade/upgrade.


Manual upgrade or downgrade

Stop running sniffer service

/etc/init.d/voipmonitor stop
# In case that service won't stop, press CTRL+C and use KILL signal to terminate the process with a force:
kill -9 `pgrep voipmonitor`
# In case that multiple instances of voipmonitor are running there, use last command multiple-times.

Choose a package version on a sourceforge site

Find voipmonitor*.tar.gz file of your choice at site https://sourceforge.net/projects/voipmonitor/files/ and use the link for wget command in step by step How To Install Sniffer

Example of wget command for version 20.4.4 with ss7(wireshark) module

wget https://sourceforge.net/projects/voipmonitor/files/20.4/voipmonitor-wireshark-amd64-20.4.4-static.tar.gz/download -O voipmonitor-wireshark-amd64-20.4.4-static.tar.gz --content-disposition --no-check-certificate


Download just a binary file directly from voipmonitor

Beware that only few latest versions are available

Example link for 32bit version of 20.4.4 sniffer binary

http://download.voipmonitor.org/senzor/download/20.4.4/voipmonitor.gz.32

Example link for 64bit version of 20.4.4 sniffer binary

http://download.voipmonitor.org/senzor/download/20.4.4/voipmonitor.gz.64

Example link for ArmV6(RPI) and SS7(wireshark) sniffer bianaries

Curently those binaries are not available directly - use steps for installing voipmonitor package from a sourceforge above to download whole package and steps to install sniffer.

step by step for upgrade using downloaded binary file for 64bit

#You can backup previous version of a sniffer
mv /usr/local/sbin/voipmonitor /usr/local/sbin/voipmonitor-backup
#Download gziped binary, rename it and unpack.
wget http://download.voipmonitor.org/senzor/download/20.4.4/voipmonitor.gz.64 --content-disposition --no-check-certificate
mv voipmonitor.gz.64 voipmonitor.gz
gunzip -c voipmonitor.gz > /usr/local/sbin/voipmonitor
#Ensure file is executable
chmod +x /usr/local/sbin/voipmonitor


Manual upgrade to develop version

Sniffer_installation#Newest_static_versions_from_develop_branch

Check installed version

Locally using binary

voipmonitor|head

Remotely using manager API of a running sniffer

echo 'sniffer_version'|nc 127.0.0.1 5029

where 127.0.0.1 is IP of a 'managerip' and 5029 is 'managerport' defined in this sniffer's config

Start installed version

/etc/init.d/voipmonitor start
#or
service voipmonitor start