Set up SmokePing for detailed network latency monitoring with visual graphs, multi-target analysis, and advanced alerting. Perfect for tracking network performance trends and identifying connectivity issues across multiple hosts.
Prerequisites
- Root access to server
- Apache or Nginx web server
- Basic networking knowledge
- Email server for alerts (optional)
What this solves
SmokePing provides detailed latency analysis and network monitoring with visual graphs that track ping response times over extended periods. Unlike basic ping utilities, SmokePing creates historical graphs showing network performance trends, packet loss patterns, and jitter analysis. This helps you identify intermittent connectivity issues, monitor SLA compliance, and troubleshoot network performance problems that standard monitoring tools might miss.
Step-by-step installation
Update system packages
Start by updating your package manager to ensure you get the latest versions of all dependencies.
sudo apt update && sudo apt upgrade -yInstall SmokePing and dependencies
Install SmokePing along with the required web server and monitoring dependencies.
sudo apt install -y smokeping apache2 rrdtool librrds-perl curl dnsutils iputils-ping
sudo a2enmod cgi
sudo systemctl enable apache2Create SmokePing directory structure
Set up the required directories for SmokePing data storage and web interface with proper permissions.
sudo mkdir -p /var/lib/smokeping/{cache,data,images}
sudo mkdir -p /var/log/smokeping
sudo chown -R smokeping:smokeping /var/lib/smokeping /var/log/smokeping
sudo chmod 755 /var/lib/smokeping/{cache,data,images}Configure SmokePing main configuration
Create the main SmokePing configuration file with basic settings and monitoring targets.
General
owner = Network Operations
contact = admin@example.com
mailhost = localhost
sendmail = /usr/sbin/sendmail
imgcache = /var/lib/smokeping/images
imgurl = http://localhost/smokeping/images
datadir = /var/lib/smokeping/data
piddir = /var/run/smokeping
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
Alerts
to = admin@example.com
from = smokeping@example.com
+someloss
type = loss
pattern = >0%,12,>0%,12,>0%
comment = loss 3 times in a row
+rttdetect
type = rtt
pattern = <10,<10,<10,<10,<10,<100,>100,>100,>100
comment = routing table changed?
Database
step = 300
pings = 20
consfn mrhb steps total
CONSOL_AVG:0.5:1:1008
CONSOL_AVG:0.5:12:4320
CONSOL_MIN:0.5:12:4320
CONSOL_MAX:0.5:12:4320
CONSOL_AVG:0.5:144:720
CONSOL_MAX:0.5:144:720
CONSOL_MIN:0.5:144:720
Presentation
template = /etc/smokeping/basepage.html
htmltitle = SmokePing Network Latency Monitoring
charset = utf-8
+ charts
menu = Charts
title = The most interesting destinations
++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f
++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds
++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f
++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median Roundtrip Time %f seconds
Probes
+ FPing
binary = /usr/bin/fping
+ DNS
binary = /usr/bin/dig
lookup = google.com
pings = 5
step = 300
+ Curl
binary = /usr/bin/curl
step = 300
pings = 5
Targets
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website. Here you will learn all about the latency of our network.
+ InternetSites
menu = Internet Sites
title = Internet Sites
++ Google
menu = Google
title = Google DNS
host = 8.8.8.8
alerts = someloss
++ Cloudflare
menu = Cloudflare
title = Cloudflare DNS
host = 1.1.1.1
alerts = someloss,rttdetect
++ OpenDNS
menu = OpenDNS
title = OpenDNS
host = 208.67.222.222
+ LocalNetwork
menu = Local Network
title = Local Network
++ Gateway
menu = Default Gateway
title = Default Gateway
host = 192.168.1.1
alerts = someloss,rttdetect
++ DNSServer
menu = Local DNS
title = Local DNS Server
host = 192.168.1.1
probe = DNS
+ WebSites
menu = Web Sites
title = Web Site Response Times
probe = Curl
++ ExampleSite
menu = Example Site
title = Example Website
host = https://example.com
extraargs = --connect-timeout 10 --max-time 60 -w "namelookup: %{time_namelookup}, connect: %{time_connect}, total: %{time_total}\n"Configure Apache web server
Set up Apache virtual host configuration to serve SmokePing web interface with proper CGI handling.
ServerName smokeping.example.com
DocumentRoot /var/www/html
ScriptAlias /smokeping/smokeping.cgi /usr/lib/cgi-bin/smokeping.cgi
Alias /smokeping/images /var/lib/smokeping/images
Alias /smokeping /usr/share/smokeping/www
Options None
AllowOverride None
Require all granted
Options None
AllowOverride None
Require all granted
Options ExecCGI
AllowOverride None
Require all granted
ErrorLog ${APACHE_LOG_DIR}/smokeping_error.log
CustomLog ${APACHE_LOG_DIR}/smokeping_access.log combined
Enable Apache site and restart services
Enable the SmokePing site configuration and restart Apache to apply the changes.
sudo a2ensite smokeping.conf
sudo systemctl restart apache2Configure SmokePing systemd service
Create a systemd service file to manage SmokePing daemon with proper startup and monitoring.
[Unit]
Description=SmokePing Network Latency Monitor
After=network.target
[Service]
Type=forking
User=smokeping
Group=smokeping
ExecStart=/usr/bin/smokeping --config=/etc/smokeping/config --logfile=/var/log/smokeping/smokeping.log --pid-dir=/var/run/smokeping
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/var/run/smokeping/smokeping.pid
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetSet up advanced monitoring targets
Configure additional monitoring targets including DNS resolution, HTTP response times, and custom network paths.
# Advanced DNS monitoring
++ DNSPerformance
menu = DNS Performance Tests
title = DNS Resolution Performance
probe = DNS
+++ GoogleDNS
menu = Google DNS
title = Google DNS Resolution
host = 8.8.8.8
lookup = example.com
+++ CloudflareDNS
menu = Cloudflare DNS
title = Cloudflare DNS Resolution
host = 1.1.1.1
lookup = example.com
HTTP response time monitoring
++ HTTPServices
menu = HTTP Services
title = HTTP Response Times
probe = Curl
+++ WebServer1
menu = Web Server 1
title = Primary Web Server
host = https://www.example.com
extraargs = --connect-timeout 10 --max-time 30 -w "DNS: %{time_namelookup}s, Connect: %{time_connect}s, Total: %{time_total}s\n"
+++ WebServer2
menu = Web Server 2
title = Secondary Web Server
host = https://backup.example.com
extraargs = --connect-timeout 10 --max-time 30 -w "DNS: %{time_namelookup}s, Connect: %{time_connect}s, Total: %{time_total}s\n"
Multi-protocol monitoring
++ NetworkInfrastructure
menu = Network Infrastructure
title = Core Network Devices
+++ CoreSwitch
menu = Core Switch
title = Data Center Core Switch
host = 192.168.10.1
pings = 10
step = 60
+++ EdgeRouter
menu = Edge Router
title = Internet Edge Router
host = 203.0.113.1
alerts = someloss,rttdetectInclude advanced targets in main config
Add the include directive to the main configuration file to load the advanced monitoring targets.
sudo mkdir -p /etc/smokeping/config.d
echo "@include /etc/smokeping/config.d/advanced-targets" | sudo tee -a /etc/smokeping/configConfigure email alerting
Set up email templates for SmokePing alerts to notify administrators of network issues.
To: <##TO##>
From: <##FROM##>
Subject: <##SUBJECT##>
Date: <##DATE##>
MIME-Version: 1.0
Content-Type: text/plain
SmokePing Alert: <##ALERT##>
Target: <##TARGET##>
Loss Pattern: <##LOSS##>
RTT Pattern: <##RTT##>
Hostname: <##HOSTNAME##>
Time: <##TIME##>
Current Readings:
<##READINGS##>
SmokePing URL: <##URL##>
This is an automated message from SmokePing.
--
Network Operations TeamSet up authentication for web interface
Configure basic HTTP authentication to secure the SmokePing web interface.
sudo htpasswd -c /etc/smokeping/.htpasswd admin
sudo chown www-data:www-data /etc/smokeping/.htpasswd
sudo chmod 644 /etc/smokeping/.htpasswdAdd authentication requirements to the Apache configuration:
sudo tee -a /etc/apache2/sites-available/smokeping.conf << 'EOF'
AuthType Basic
AuthName "SmokePing Network Monitor"
AuthUserFile /etc/smokeping/.htpasswd
Require valid-user
EOFEnable and start SmokePing
Enable SmokePing to start automatically on boot and start the service.
sudo systemctl daemon-reload
sudo systemctl enable --now smokeping
sudo systemctl restart apache2 || sudo systemctl restart httpdConfigure advanced alerting and notifications
Set up custom alert conditions
Create advanced alert patterns for different types of network issues and performance degradation.
Alerts
to = network-ops@example.com
from = smokeping@example.com
+highlatency
type = rtt
pattern = >200,>200,>200
comment = High latency detected (>200ms for 3 consecutive measurements)
edgeTrigger = yes
+packetloss
type = loss
pattern = ==0%,==0%,==0%,==0%,>0%,>0%,>0%
comment = Packet loss detected after stable period
edgeTrigger = yes
+intermittentloss
type = loss
pattern = >5%,10,>5%,10,>5%
comment = Intermittent packet loss pattern detected
+jitter
type = rtt
pattern = <100,>300,<100,>300,<100,>300
comment = High jitter detected (RTT variance >200ms)
+sitecritical
type = loss
pattern = >50%,>50%,>50%
comment = Critical: Site mostly unreachable
edgeTrigger = yes
+dnsdelay
type = rtt
pattern = >5000,>5000,>5000
comment = DNS resolution taking longer than 5 seconds
edgeTrigger = yesConfigure notification escalation
Set up escalation rules to send alerts to different teams based on severity and duration.
#!/bin/bash
SmokePing Alert Escalation Script
ALERT_TYPE="$1"
TARGET="$2"
LOSS="$3"
RTT="$4"
HOSTNAME="$5"
Determine severity based on alert type
case "$ALERT_TYPE" in
"sitecritical")
SEVERITY="CRITICAL"
RECIPIENTS="ops-team@example.com,management@example.com"
;;
"packetloss"|"highlatency")
SEVERITY="WARNING"
RECIPIENTS="network-ops@example.com"
;;
"jitter"|"intermittentloss")
SEVERITY="INFO"
RECIPIENTS="monitoring@example.com"
;;
*)
SEVERITY="UNKNOWN"
RECIPIENTS="ops-team@example.com"
;;
esac
Send notification with severity context
echo "SmokePing Alert [$SEVERITY]: $ALERT_TYPE for $TARGET" | \
mail -s "[$SEVERITY] SmokePing: $TARGET" "$RECIPIENTS"
Log alert for audit trail
echo "$(date): $SEVERITY alert for $TARGET - $ALERT_TYPE" >> /var/log/smokeping/alerts.logsudo chmod +x /etc/smokeping/escalation
sudo chown smokeping:smokeping /etc/smokeping/escalationSet up Slack webhook integration
Configure SmokePing to send alerts to Slack channels for real-time team notifications.
#!/bin/bash
SmokePing Slack Notification Script
SLACK_WEBHOOK="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK"
ALERT_TYPE="$1"
TARGET="$2"
LOSS="$3"
RTT="$4"
HOSTNAME="$5"
TIME="$(date)"
Determine color and icon based on alert type
case "$ALERT_TYPE" in
"sitecritical"|"packetloss")
COLOR="danger"
ICON=":rotating_light:"
;;
"highlatency"|"jitter")
COLOR="warning"
ICON=":warning:"
;;
*)
COLOR="good"
ICON=":information_source:"
;;
esac
Create Slack message payload
PAYLOAD=$(cat <Send to Slack
curl -X POST -H 'Content-type: application/json' \
--data "$PAYLOAD" \
"$SLACK_WEBHOOK"
Log notification
echo "$(date): Slack notification sent for $ALERT_TYPE on $TARGET" >> /var/log/smokeping/notifications.log sudo chmod +x /etc/smokeping/slack-notify.sh
sudo chown smokeping:smokeping /etc/smokeping/slack-notify.shConfigure log rotation
Set up log rotation to prevent SmokePing log files from consuming excessive disk space.
/var/log/smokeping/*.log {
daily
rotate 30
compress
delaycompress
missingok
notifempty
create 644 smokeping smokeping
postrotate
/bin/systemctl reload smokeping > /dev/null 2>&1 || true
endscript
}Verify your setup
Check that SmokePing is running correctly and generating monitoring data.
sudo systemctl status smokeping
sudo systemctl status apache2 || sudo systemctl status httpd
sudo ls -la /var/lib/smokeping/data/
sudo tail -f /var/log/smokeping/smokeping.logTest the web interface and verify data collection:
curl -I http://localhost/smokeping/
find /var/lib/smokeping/images -name "*.png" -mmin -10
smokeping --config=/etc/smokeping/config --checkCommon issues
| Symptom | Cause | Fix |
|---|---|---|
| Web interface shows 500 error | CGI permissions or Apache config | sudo chmod +x /usr/lib/cgi-bin/smokeping.cgi and check Apache error logs |
| No graphs generated | RRD permissions or data directory | sudo chown -R smokeping:smokeping /var/lib/smokeping |
| Smokeping service fails to start | Configuration syntax error | smokeping --config=/etc/smokeping/config --check |
| DNS probe not working | Missing dig binary or permissions | sudo apt install dnsutils or sudo dnf install bind-utils |
| Curl probe timeouts | Firewall blocking outbound HTTPS | Check firewall rules and network connectivity |
| Alerts not sending | Mail system not configured | Install and configure postfix or sendmail |
Next steps
- Configure SNMP v3 authentication and encryption for secure network monitoring to complement SmokePing with device-level metrics
- Monitor cron jobs and systemd timers with Prometheus and Grafana alerting for comprehensive system monitoring integration
- Configure SmokePing with Grafana dashboards for advanced visualization
- Setup SmokePing distributed monitoring with multiple collection points
Running this in production?
Automated install script
Run this to automate the entire setup
#!/usr/bin/env bash
set -euo pipefail
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Default values
ADMIN_EMAIL="${1:-admin@example.com}"
SERVER_NAME="${2:-smokeping.localhost}"
# Usage message
show_usage() {
echo "Usage: $0 [admin_email] [server_name]"
echo "Example: $0 admin@company.com monitoring.company.com"
exit 1
}
# Logging functions
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
# Cleanup function
cleanup() {
log_error "Installation failed. Rolling back changes..."
systemctl stop smokeping 2>/dev/null || true
systemctl disable smokeping 2>/dev/null || true
rm -f /etc/smokeping/config.d/General /etc/smokeping/config.d/Alerts /etc/smokeping/config.d/Database /etc/smokeping/config.d/Presentation /etc/smokeping/config.d/Probes /etc/smokeping/config.d/Targets
exit 1
}
trap cleanup ERR
# Check if running as root
if [[ $EUID -ne 0 ]]; then
log_error "This script must be run as root or with sudo"
exit 1
fi
# Detect distribution
if [ -f /etc/os-release ]; then
. /etc/os-release
case "$ID" in
ubuntu|debian)
PKG_MGR="apt"
PKG_INSTALL="apt install -y"
WEB_SERVICE="apache2"
WEB_CONFIG_DIR="/etc/apache2/sites-available"
WEB_ENABLE_CMD="a2ensite smokeping.conf && a2enmod cgi"
SMOKEPING_USER="smokeping"
;;
almalinux|rocky|centos|rhel|ol|fedora)
PKG_MGR="dnf"
PKG_INSTALL="dnf install -y"
WEB_SERVICE="httpd"
WEB_CONFIG_DIR="/etc/httpd/conf.d"
WEB_ENABLE_CMD="true"
SMOKEPING_USER="smokeping"
;;
amzn)
PKG_MGR="yum"
PKG_INSTALL="yum install -y"
WEB_SERVICE="httpd"
WEB_CONFIG_DIR="/etc/httpd/conf.d"
WEB_ENABLE_CMD="true"
SMOKEPING_USER="smokeping"
;;
*)
log_error "Unsupported distribution: $ID"
exit 1
;;
esac
else
log_error "Cannot detect distribution"
exit 1
fi
log_info "[1/8] Updating system packages..."
if [[ "$PKG_MGR" == "apt" ]]; then
apt update && apt upgrade -y
elif [[ "$PKG_MGR" == "dnf" || "$PKG_MGR" == "yum" ]]; then
$PKG_MGR update -y
if [[ "$ID" != "fedora" ]]; then
$PKG_INSTALL epel-release
fi
fi
log_info "[2/8] Installing SmokePing and dependencies..."
if [[ "$PKG_MGR" == "apt" ]]; then
$PKG_INSTALL smokeping apache2 rrdtool librrds-perl curl dnsutils iputils-ping
a2enmod cgi
else
$PKG_INSTALL smokeping httpd rrdtool-perl curl bind-utils iputils
fi
log_info "[3/8] Creating SmokePing directory structure..."
mkdir -p /var/lib/smokeping/{cache,data,images}
mkdir -p /var/log/smokeping
mkdir -p /etc/smokeping/config.d
# Create smokeping user if it doesn't exist
if ! id "$SMOKEPING_USER" &>/dev/null; then
useradd -r -s /bin/false -d /var/lib/smokeping "$SMOKEPING_USER"
fi
chown -R $SMOKEPING_USER:$SMOKEPING_USER /var/lib/smokeping /var/log/smokeping
chmod 755 /var/lib/smokeping/{cache,data,images}
log_info "[4/8] Configuring SmokePing..."
cat > /etc/smokeping/config.d/General << EOF
*** General ***
owner = Network Operations
contact = $ADMIN_EMAIL
mailhost = localhost
sendmail = /usr/sbin/sendmail
imgcache = /var/lib/smokeping/images
imgurl = http://$SERVER_NAME/smokeping/images
datadir = /var/lib/smokeping/data
piddir = /run/smokeping
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
EOF
cat > /etc/smokeping/config.d/Alerts << 'EOF'
*** Alerts ***
to = admin@example.com
from = smokeping@example.com
+someloss
type = loss
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
+rttdetect
type = rtt
pattern = <10,<10,<10,<10,<10,<100
comment = round trip time > 100ms
EOF
cat > /etc/smokeping/config.d/Database << 'EOF'
*** Database ***
step = 300
pings = 20
EOF
cat > /etc/smokeping/config.d/Presentation << 'EOF'
*** Presentation ***
template = /etc/smokeping/basepage.html
htmltitle = yes
graphborders = no
+ charts
menu = Charts
title = The most interesting destinations
++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f
++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds
++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f
++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median Roundtrip Time %f seconds
EOF
cat > /etc/smokeping/config.d/Probes << 'EOF'
*** Probes ***
+ FPing
binary = /usr/bin/fping
+ DNS
binary = /usr/bin/dig
lookup = google.com
pings = 5
step = 300
+ Curl
binary = /usr/bin/curl
step = 300
pings = 5
EOF
cat > /etc/smokeping/config.d/Targets << 'EOF'
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to SmokePing. Monitor network latency and performance.
+ InternetSites
menu = Internet Sites
title = Internet Sites
++ Google
menu = Google
title = Google DNS
host = 8.8.8.8
alerts = someloss
++ Cloudflare
menu = Cloudflare
title = Cloudflare DNS
host = 1.1.1.1
alerts = someloss,rttdetect
++ OpenDNS
menu = OpenDNS
title = OpenDNS
host = 208.67.222.222
+ LocalNetwork
menu = Local Network
title = Local Network
++ Gateway
menu = Default Gateway
title = Default Gateway
host = 192.168.1.1
alerts = someloss,rttdetect
EOF
# Create main config file
cat > /etc/smokeping/config << 'EOF'
@include /etc/smokeping/config.d/General
@include /etc/smokeping/config.d/Alerts
@include /etc/smokeping/config.d/Database
@include /etc/smokeping/config.d/Presentation
@include /etc/smokeping/config.d/Probes
@include /etc/smokeping/config.d/Targets
EOF
log_info "[5/8] Configuring web server..."
if [[ "$PKG_MGR" == "apt" ]]; then
cat > $WEB_CONFIG_DIR/smokeping.conf << EOF
<VirtualHost *:80>
ServerName $SERVER_NAME
DocumentRoot /var/www/html
ScriptAlias /smokeping/smokeping.cgi /usr/lib/cgi-bin/smokeping.cgi
Alias /smokeping/images /var/lib/smokeping/images
Alias /smokeping /usr/share/smokeping/www
<Directory "/usr/share/smokeping/www">
Options None
AllowOverride None
Require all granted
</Directory>
<Directory "/var/lib/smokeping/images">
Options None
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI
Require all granted
</Directory>
</VirtualHost>
EOF
else
cat > $WEB_CONFIG_DIR/smokeping.conf << EOF
<VirtualHost *:80>
ServerName $SERVER_NAME
DocumentRoot /var/www/html
ScriptAlias /smokeping/smokeping.cgi /usr/share/smokeping/cgi/smokeping.cgi
Alias /smokeping/images /var/lib/smokeping/images
Alias /smokeping /usr/share/smokeping/htdocs
<Directory "/usr/share/smokeping/htdocs">
Options None
AllowOverride None
Require all granted
</Directory>
<Directory "/var/lib/smokeping/images">
Options None
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/share/smokeping/cgi">
AllowOverride None
Options ExecCGI
Require all granted
</Directory>
</VirtualHost>
EOF
fi
log_info "[6/8] Enabling services..."
eval "$WEB_ENABLE_CMD"
systemctl enable $WEB_SERVICE smokeping
systemctl start $WEB_SERVICE
systemctl start smokeping
log_info "[7/8] Configuring firewall..."
if command -v ufw >/dev/null 2>&1; then
ufw allow 80/tcp
elif command -v firewall-cmd >/dev/null 2>&1; then
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
fi
log_info "[8/8] Verifying installation..."
sleep 5
if systemctl is-active --quiet smokeping; then
log_info "SmokePing service is running"
else
log_error "SmokePing service failed to start"
exit 1
fi
if systemctl is-active --quiet $WEB_SERVICE; then
log_info "Web server is running"
else
log_error "Web server failed to start"
exit 1
fi
if [ -d /var/lib/smokeping/data ] && [ "$(ls -A /var/lib/smokeping/data 2>/dev/null | wc -l)" -gt 0 ]; then
log_info "Data collection has started"
else
log_warn "Data collection may take a few minutes to begin"
fi
log_info "SmokePing installation completed successfully!"
echo
echo "Access SmokePing at: http://$SERVER_NAME/smokeping/"
echo "Configuration files: /etc/smokeping/config.d/"
echo "Data directory: /var/lib/smokeping/"
echo "Log directory: /var/log/smokeping/"
echo
echo "Wait 5-10 minutes for initial data collection before viewing graphs."
Review the script before running. Execute with: bash install.sh