Sniffer upgrade: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= upgrade from web GUI =
{{DISPLAYTITLE:Upgrading and Downgrading the Sniffer}}
Go to settings -> sensors and do the upgrade from there.


= upgrade to the latest versions (64bit)=
'''This guide provides step-by-step instructions for upgrading or downgrading the VoIPmonitor sensor (sniffer). There are two primary methods: using the Web GUI for simplicity, or performing a manual update via the command line for more control.'''


#this is example for 9.4beta23
== Method 1: Upgrading via the Web GUI (Recommended) ==
wget download.voipmonitor.org/senzor/download/9.4beta23/voipmonitor.gz.64 (or 32 if you have 32bit)
This is the easiest and safest way to manage your sensor versions. This method only works for sensors that are currently running and connected to the GUI.
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 =
# Navigate to '''Settings -> Sensors''' in the VoIPmonitor GUI.
Since version 5.1 database is upgraded and populated automatically during first run (if mysql credential is set properly – CREATE and ALTER is needed).  
# Find the sensor you wish to update. If you need to see more details or older versions, click the '''[+]''' icon to expand the sensor's information.
# Click the blue '''UPGRADE''' button. A dropdown menu will appear.
# Select the desired version from the list. The list will contain the latest stable release as well as several previous versions for downgrading.
# The GUI will automatically handle the download and restart of the remote sensor service.


= Upgrade from 5.0 to 5.1 =
== Method 2: Manual Upgrade/Downgrade (via Command Line) ==
Upgrading database from 5.0 do not changes cdr table and thus the upgrade is instant. Here is the procedure
This method gives you full control and is necessary if the GUI method is not available or if you need to install a specific development build.
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


=== Step 1: Stop the Running Sniffer ===
First, log in to the sensor's server via SSH and stop the service. For modern systems using systemd:
<pre>
systemctl stop voipmonitor
</pre>
For older systems using SysV init:
<pre>
/etc/init.d/voipmonitor stop
</pre>
''Tip: If the service fails to stop, you may need to terminate the process manually as a last resort: `killall -9 voipmonitor`''


= Upgrade from 4.2 to 5.0 =
=== Step 2: Download the Sniffer Archive ===
Download the latest stable static binary from the official VoIPmonitor website. This package contains all necessary files.
<pre>
# This command downloads the latest stable 64-bit static sniffer
wget https://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O voipmonitor-sniffer.tar.gz
</pre>
If you need a specific older version or a special build (like one with SS7 support), you must get the direct download link from the support team or historical archives and use it with the `wget` command.


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:
=== Step 3: Install the New Binary ===
#create new database
<pre>
mysqladmin create voipmonitor5
# Extract the downloaded archive
cat cdrtable.sql | mysql voipmonitor5
tar xzf voipmonitor-sniffer.tar.gz
cd voipmonitor/scripts


#edit mysql_copy_4.2to5.0.php and set appropriate constants:
# Navigate into the new directory. The wildcard (*) handles any version number.
define("HOST", "localhost");
cd voipmonitor-*-static
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
# (Recommended) Back up your old binary
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)
mv /usr/local/sbin/voipmonitor /usr/local/sbin/voipmonitor.backup
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).
 
# Copy the new binary into place
cp ./voipmonitor /usr/local/sbin/voipmonitor
 
# Ensure the new binary is executable
chmod +x /usr/local/sbin/voipmonitor
</pre>
 
=== Step 4: Start the Service ===
Finally, start the sniffer service again.
<pre>
systemctl start voipmonitor
</pre>
Or for older systems:
<pre>
/etc/init.d/voipmonitor start
</pre>
 
== Verifying the Version ==
After an upgrade or downgrade, it's important to verify that the correct version is running.
 
=== Local Check ===
You can check the version directly from the binary on the sensor's server:
<pre>
/usr/local/sbin/voipmonitor --version
</pre>
Or, for more detail:
<pre>
/usr/local/sbin/voipmonitor | head
</pre>
 
=== Remote Check (via Manager API) ===
If the sniffer is running, you can query its version remotely using its manager API (default port 5029):
<pre>
echo 'sniffer_version' | nc 127.0.0.1 5029
</pre>
 
== AI Summary for RAG ==
'''Summary:''' This guide details the procedures for upgrading or downgrading the VoIPmonitor sensor. It presents two primary methods. The first and recommended method is using the Web GUI, by navigating to "Settings -> Sensors" and selecting a new version from the upgrade dropdown menu. The second method is a manual update via the command line, which involves four steps: 1) Stopping the voipmonitor service (`systemctl stop voipmonitor`). 2) Downloading the desired static binary `tar.gz` package using `wget`. 3) Backing up the old binary, copying the new one to `/usr/local/sbin/`, and setting execute permissions with `chmod`. 4) Starting the service again. The article concludes by showing how to verify the currently installed version, both locally (`voipmonitor --version`) and remotely via the manager API.
'''Keywords:''' upgrade, downgrade, update, sniffer, sensor, install, new version, old version, GUI upgrade, manual upgrade, command line, CLI, wget, tar.gz, systemctl, service, check version, verify, voipmonitor.org/download
'''Key Questions:'''
* How do I upgrade the VoIPmonitor sniffer?
* How can I downgrade the sensor to a previous version?
* What is the easiest way to update my remote sensors?
* How do I perform a manual upgrade of the sniffer using the command line?
* How can I check which version of the sniffer I am currently running?
* Where can I download the latest stable sniffer binary?

Latest revision as of 16:35, 30 June 2025


This guide provides step-by-step instructions for upgrading or downgrading the VoIPmonitor sensor (sniffer). There are two primary methods: using the Web GUI for simplicity, or performing a manual update via the command line for more control.

Method 1: Upgrading via the Web GUI (Recommended)

This is the easiest and safest way to manage your sensor versions. This method only works for sensors that are currently running and connected to the GUI.

  1. Navigate to Settings -> Sensors in the VoIPmonitor GUI.
  2. Find the sensor you wish to update. If you need to see more details or older versions, click the [+] icon to expand the sensor's information.
  3. Click the blue UPGRADE button. A dropdown menu will appear.
  4. Select the desired version from the list. The list will contain the latest stable release as well as several previous versions for downgrading.
  5. The GUI will automatically handle the download and restart of the remote sensor service.

Method 2: Manual Upgrade/Downgrade (via Command Line)

This method gives you full control and is necessary if the GUI method is not available or if you need to install a specific development build.

Step 1: Stop the Running Sniffer

First, log in to the sensor's server via SSH and stop the service. For modern systems using systemd:

systemctl stop voipmonitor

For older systems using SysV init:

/etc/init.d/voipmonitor stop

Tip: If the service fails to stop, you may need to terminate the process manually as a last resort: `killall -9 voipmonitor`

Step 2: Download the Sniffer Archive

Download the latest stable static binary from the official VoIPmonitor website. This package contains all necessary files.

# This command downloads the latest stable 64-bit static sniffer
wget https://www.voipmonitor.org/current-stable-sniffer-static-64bit.tar.gz -O voipmonitor-sniffer.tar.gz

If you need a specific older version or a special build (like one with SS7 support), you must get the direct download link from the support team or historical archives and use it with the `wget` command.

Step 3: Install the New Binary

# Extract the downloaded archive
tar xzf voipmonitor-sniffer.tar.gz

# Navigate into the new directory. The wildcard (*) handles any version number.
cd voipmonitor-*-static

# (Recommended) Back up your old binary
mv /usr/local/sbin/voipmonitor /usr/local/sbin/voipmonitor.backup

# Copy the new binary into place
cp ./voipmonitor /usr/local/sbin/voipmonitor

# Ensure the new binary is executable
chmod +x /usr/local/sbin/voipmonitor

Step 4: Start the Service

Finally, start the sniffer service again.

systemctl start voipmonitor

Or for older systems:

/etc/init.d/voipmonitor start

Verifying the Version

After an upgrade or downgrade, it's important to verify that the correct version is running.

Local Check

You can check the version directly from the binary on the sensor's server:

/usr/local/sbin/voipmonitor --version

Or, for more detail:

/usr/local/sbin/voipmonitor | head

Remote Check (via Manager API)

If the sniffer is running, you can query its version remotely using its manager API (default port 5029):

echo 'sniffer_version' | nc 127.0.0.1 5029

AI Summary for RAG

Summary: This guide details the procedures for upgrading or downgrading the VoIPmonitor sensor. It presents two primary methods. The first and recommended method is using the Web GUI, by navigating to "Settings -> Sensors" and selecting a new version from the upgrade dropdown menu. The second method is a manual update via the command line, which involves four steps: 1) Stopping the voipmonitor service (`systemctl stop voipmonitor`). 2) Downloading the desired static binary `tar.gz` package using `wget`. 3) Backing up the old binary, copying the new one to `/usr/local/sbin/`, and setting execute permissions with `chmod`. 4) Starting the service again. The article concludes by showing how to verify the currently installed version, both locally (`voipmonitor --version`) and remotely via the manager API. Keywords: upgrade, downgrade, update, sniffer, sensor, install, new version, old version, GUI upgrade, manual upgrade, command line, CLI, wget, tar.gz, systemctl, service, check version, verify, voipmonitor.org/download Key Questions:

  • How do I upgrade the VoIPmonitor sniffer?
  • How can I downgrade the sensor to a previous version?
  • What is the easiest way to update my remote sensors?
  • How do I perform a manual upgrade of the sniffer using the command line?
  • How can I check which version of the sniffer I am currently running?
  • Where can I download the latest stable sniffer binary?