DEV Community

Bidhan Khatri
Bidhan Khatri

Posted on • Updated on • Originally published at bidhankhatri.com.np

Install SmokePing 2.7.3 on CentOS 7

SmokePing is a latency measurement tool. The SmokePing Project can measure, store and display latency, latency distribution, and packet loss. SmokePing uses RRDtool to maintain a long-term data archive and develop beautiful graphics, waiving precise information on the status of each network connection.

Follow the below steps to set up SmokePing version 2.7.3 on the centos 7 machines.

yum install epel-release
yum groupinstall "Development tools" 
yum install perl httpd httpd-devel mod_fcgid rrdtool perl-CGI-SpeedyCGI fping rrdtool-perl perl-Sys-Syslog openssl-devel perl-CPAN perl-local-lib perl-Time-HiRes perl-e wget perl-rrdtool

Download the latest SmokePing version.

wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.7.3.tar.gz
tar xvf smokeping-2.7.3.tar.gz
cd smokeping-2.7.3
cp -r thirdparty /opt/smokeping/
./configure --prefix=/opt/smokeping
/usr/bin/gmake install

configure smokeping.

mkdir -p /var/www/smokeping/data
mkdir /opt/smokeping/var
mkdir /var/www/smokeping/cache
cp -R /opt/smokeping/htdocs/* /var/www/smokeping
mv /var/www/smokeping/smokeping.fcgi.dist /var/www/smokeping/smokeping.fcgi
chown -R apache:apache /var/www/smokeping
cp /opt/smokeping/etc/config.dist /opt/smokeping/etc/config
chmod 600 /opt/smokeping/etc/smokeping_secrets.dist

Add/Edit below parameters according to your requirement.

vim /opt/smokeping/etc/config

owner = Bdn Server
contact = system@bdn.com.np
imgcache = /var/www/smokeping/cache
datadir = /var/www/smokeping/data

*** Alerts ***
to = admin@bdn.com.np
from = smokeping@bdn.com.np

+hostdown
type = loss
pattern = ==0%,==0%,==0%, ==U
comment = no reply

*** Targets ***
probe = FPing

menu = Top
title = Network Latency Grapher
+ server
menu= Targets

++ dns-01
menu = dns-01 [172.28.255.101]
title = dns-01 [172.28.255.101]
host = 172.28.255.101
alerts = someloss,hostdown

vim /etc/httpd/conf.d/smokeping.conf

Alias /smokeping "/var/www/smokeping"
<Directory /var/www/smokeping>
Options Indexes FollowSymLinks MultiViews ExecCGI  
 AllowOverride All  
 Order allow,deny  
 Allow from all 
DirectoryIndex smokeping.fcgi
</Directory>

check configuration and restart httpd service.

httpd -t
systemctl start httpd && systemctl enable httpd

Smokeping version 2.7.3 release breaks the old fping version so we have to install fping version 4 manually as our distribution does not provide the latest fping package.
But first, remove the existing fping package.

rpm -qa | grep fping
yum remove fping

Compilation Steps:

wget http://fping.org/dist/fping-4.4.tar.gz
tar xvf fping-4.4.tar.gz
cd fping-4.4
./configure --prefix=/usr/local --enable-ipv4 --enable-ipv6
make
make install

whereis fping
fping: /usr/local/sbin/fping

now edit smokeping config file to define the absolute path.

vim /opt/smokeping/etc/config

FPing
#binary = /usr/sbin/fping
binary = /usr/local/sbin/fping

save and exit.
Now, create SmokePing systemd file.

vim /usr/lib/systemd/system/smokeping.service

[Unit]
Description=Smokeping Server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
ExecStart=/opt/smokeping/bin/smokeping --nodaemon -- 
config=/opt/smokeping/etc/config --
logfile=/var/log/smokeping.log

[Install]
WantedBy=multi-user.target

Restart Services.

systemctl start smokeping && systemctl enable smokeping
systemctl restart httpd

Now access the SmokePing GUI through
URL: http://yoursername/smokeping

Tha'ts it!!

Top comments (0)