Disaster Recovery

From VoIPmonitor.org


Recovery procedure after disk failure requiring OS and VoIPmonitor reinstallation.

Overview

When a disk fails and requires replacement, recovery involves:

  1. Customer: Replace hardware, install OS, configure network, provide remote access
  2. Support: Install VoIPmonitor, restore configuration, verify operation

ℹ️ Note: Self-service installation is possible using Sniffer Installation and GUI Installation guides if you have VoIPmonitor expertise.

Step 1: Hardware & OS

Replace failed disks and install a supported OS:

OS Status
Ubuntu 24.04 LTS Recommended
Debian 12/13 Supported
Rocky Linux 9/10 Supported
CentOS 7 EOL - migrate to Rocky/Alma

⚠️ Warning: Do not copy binaries from old disk if OS version differs. Always install VoIPmonitor fresh using the official installer.

Step 2: Network Configuration

Configure network interfaces to match original server:

  • Same IP address (for fixed configurations)
  • DNS servers and routing
  • SPAN/TAP port connectivity (for sniffer servers)

Step 3: Timezone Configuration

⚠️ Warning: CRITICAL: PCAP paths use local time (/var/spool/voipmonitor/YYYY-MM-DD/HH/MM). Timezone mismatch prevents GUI from finding historical recordings.

# Check current timezone
timedatectl

# Set timezone (must match original server)
sudo timedatectl set-timezone Europe/Prague

# Verify
timedatectl

Step 4: Provide Remote Access

Choose one method for VoIPmonitor support staff:

Method A: Direct SSH

# Create support user (optional but recommended)
adduser supportuser
usermod -aG sudo supportuser

# Verify SSH is running
systemctl status sshd

Method B: VPN Access

Provide VPN credentials and server internal IP.

Method C: Reverse SSH Tunnel

For servers behind firewalls without direct SSH access:

# Run on your internal server (connects to your bastion host)
ssh -R 2222:localhost:22 -N support@bastion.yourdomain.com

# Support connects via: ssh -p 2222 user@bastion.yourdomain.com

Step 5: VoIPmonitor Installation

Support staff will install and configure based on deployment type:

Deployment Type Tasks
Sniffer-Only Install binary, configure interface, connect to central server, restore voipmonitor.conf
GUI/Database Install MariaDB/MySQL, GUI, PHP dependencies, restore configuration
All-in-One All of the above, reconstruct database from PCAPs if needed

Step 6: Data Recovery

Case 1: Database Backup Available

# Restore from mysqldump
gunzip < backup.sql.gz | mysql -u root -p voipmonitor

For GUI configuration restore, see Backup & Restore Guide.

Case 2: PCAP Files Survived

If PCAPs can be recovered from separate storage or mounted old disk:

# 1. Restore PCAP files to spooldir
rsync -avz /mnt/old_disk/var/spool/voipmonitor/ /var/spool/voipmonitor/

# 2. Create fresh database
mysql -e "CREATE DATABASE voipmonitor;"

# 3. Restore GUI configuration first (if available)
# See: Backing_Up_GUI_Configuration

# 4. Reconstruct database from PCAPs (use a config with saving disabled)
cd /var/www/html/scripts
perl process_spooldir.pl --voipcfg=/etc/voipmonitor-reprocess.conf --spooldir=/var/spool/voipmonitor \
  --fromdate='2026-05-13 00:00' --todate='2026-05-13 00:59'

ℹ️ Note: This can take days or weeks for a large spooldir, so start with one hour and check the result in the GUI. The config file and all other details are described in process_spooldir.pl.

Case 3: No Backups

  • Historical data is permanently lost
  • System must be reconfigured from scratch
  • Implement backup strategy (see Prevention below)

Step 7: Verification

# Check service status
systemctl status voipmonitor

# View logs
journalctl -u voipmonitor -f

# For GUI server
systemctl status apache2  # or nginx

Verify in GUI:

  • Sensors connected (distributed mode)
  • New calls being captured
  • Historical recordings accessible (if restored)

Prevention

Implement these measures to minimize future data loss:

Measure Description Reference
GUI Backups Daily automated backup of configuration, users, alerts Backing_Up_GUI_Configuration
Separate PCAP Storage Move spooldir to NAS/SAN/separate disk Data Cleaning
Database Replication Master-master or dual-write for HA Redundant_database
Database Backups Regular mysqldump to off-site storage See below
Disk Health Monitoring SMART monitoring for early warning See below

Database Backup Cron

# /etc/cron.d/voipmonitor-backup
0 2 * * * root mysqldump -u root -pPASSWORD voipmonitor | gzip > /backup/db_$(date +\%Y\%m\%d).sql.gz

Disk Health Monitoring

# Install smartmontools
apt-get install smartmontools

# Check disk SMART status
smartctl -a /dev/sda

See Also

AI Summary for RAG

Summary: Disaster recovery procedure after VoIPmonitor server disk failure. Workflow: (1) Replace hardware; (2) Install supported OS (Ubuntu 24.04, Debian 12/13, Rocky Linux 9/10 recommended); (3) Configure network to match original; (4) Set timezone - CRITICAL because PCAP paths use local time format /var/spool/voipmonitor/YYYY-MM-DD/HH/MM; (5) Provide remote access to support (SSH, VPN, or reverse tunnel); (6) Support installs VoIPmonitor. Data recovery options: database backup restore via mysqldump, PCAP reconstruction using the process_spooldir.pl script from the GUI scripts folder (the --readpcapdir option does not exist), or start fresh if no backups. Prevention: automated GUI backups, separate PCAP storage on NAS/SAN, database replication, regular mysqldump, SMART disk monitoring.

Keywords: disaster recovery, disk failure, data recovery, OS reinstall, timezone configuration, PCAP restoration, database reconstruction, process_spooldir.pl, spooldir, remote access, SSH tunnel, reverse tunnel, VPN, mysqldump, smartctl, backup strategy, NAS, SAN, high availability

Key Questions:

  • What do I do after a disk failure on my VoIPmonitor server?
  • How do I recover VoIPmonitor after complete disk failure?
  • Why is timezone critical after disk failure recovery?
  • How do I provide remote access to VoIPmonitor support?
  • How do I reconstruct VoIPmonitor database from PCAP files?
  • Can I recover PCAP files if the database is lost?
  • What backups should I have for disaster recovery?
  • How do I set up a reverse SSH tunnel for support access?