Smokeping merupakah senjata utama untuk memonitoring services yang menggunakan PING/ICMP. Tidak semua versi smokeping tersedia di Debian 11, untuk itu kita harus compile dari awal untuk versi terbaru, karena kemungkinan besar versi terbaru tidak akan di ikutkan di Debian 11.

Mari mulai proses instalasi Smokeping 2.8.x di Debian 11 (“bullseye”)

Install Dependency

Install dependency berikut ini agar proses compile berjalan dengan sempurna.

sudo apt install gcc make libwww-perl libcgi-fast-perl libtext-soundex-perl libio-pty-perl libcrypt-ssleay-perl rrdtool librrds-perl libssl-dev -y

tambahannya kita install wget, yang akan digunakan untuk mendownload source Smokeping 2.8.2

sudo apt install wget -y

Install fping

Aplikasi ini yang akan digunakan untuk ping ke semua IP/Domain yang digunakan. Install fping dengan cara

sudo apt install fping -y

Download dan Install Smokeping 2.8.x

Saat ini versi terbaru adalah 2.8.2, cara yang sama bisa dijalankan untuk menginstall semua versi 2.8.x, download versi 2.8.2

wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.8.2.tar.gz
# extract 
tar zxvf smokeping-2.8.2.tar.gz
# pindah ke folder smokeping
cd smokeping-2.8.2

Compile dan install

export LC_ALL=C
./configure --prefix=/usr/local/smokeping
# install
sudo make install

proses compile smokeping 2.8.2
tunggu beberapa waktu sampai instalasi selesai dan tidak ada informasi error diakhir instalasi.

Konfigurasi Smokeping 2.8.x

Buat folder untuk menyimpan cache dan data Smokeping

sudo mkdir /usr/local/smokeping/cache
sudo mkdir /usr/local/smokeping/data
sudo mkdir /usr/local/smokeping/var

Buat file baru /usr/local/smokeping/etc/config, untuk konfigurasi smokeping yang berisi

*** General ***
owner    = Jaranguda
contact  = some@address.nowhere
mailhost = my.mail.host
imgcache = /usr/local/smokeping/cache
imgurl   = cache
datadir  = /usr/local/smokeping/data
piddir  = /usr/local/smokeping/var
cgiurl   = http://some.url/smokeping.cgi
smokemail = /usr/local/smokeping/etc/smokemail.dist
tmail = /usr/local/smokeping/etc/tmail.dist
syslogfacility = smokeping
 
*** Alerts ***
to = alertee@address.somewhere
from = smokealert@company.xy
+someloss
type = loss
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row
 
*** Database ***
step     = 300
pings    = 20
AVERAGE  0.5   1  1008
AVERAGE  0.5  12  4320
    MIN  0.5  12  4320
    MAX  0.5  12  4320
AVERAGE  0.5 144   720
    MAX  0.5 144   720
    MIN  0.5 144   720
 
*** Presentation ***
template = /usr/local/smokeping/etc/basepage.html.dist
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 RTT %f seconds
 
+ overview 
 
width = 600
height = 50
range = 10h
 
+ detail
 
width = 600
height = 200
unison_tolerance = 2
 
"Last 3 Hours"    3h
"Last 30 Hours"   30h
"Last 10 Days"    10d
"Last 360 Days"   360d
 
 
*** Probes ***
+ FPing
binary = /usr/bin/fping
 
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of jaranguda.com Company.
 
+ DNS
menu = DNS
title = DNS Server
 
++ OpenDNS
menu = OpenDNS
title = OpenDNS
host = 208.67.222.222
 
++ Google
menu = GoogleDNS
title = GoogleDNS
host = 8.8.4.4
 
++ Cloudflare-DNS
menu = Cloudflare-DNS
title = Cloudflare-DNS
host = 1.1.1.1

test config yang baru dibuat

sudo /usr/local/smokeping/bin/smokeping --debug

smokeping debug mode

Systemd Smokeping

Agar mudah mengaktifkan smokeping sewaktu boot, maupun stop, start. Kita gunakan service systemd, buat file /usr/lib/systemd/system/smokeping.service yang berisi

[Unit]
Description=Smokeping Server
After=network.target
 
[Service]
Type=simple
ExecStart=/usr/local/smokeping/bin/smokeping --nodaemon /usr/local/smokeping/etc/config --logfile=/var/log/smokeping.log
 
[Install]
WantedBy=multi-user.target

lalu jalankan

# aktifkan sewaktu booting
sudo systemctl enable smokeping
# jalankan
sudo systemctl start smokeping
# cek status
sudo systemctl status smokeping

Web UI Smokeping

Grafik smokeping bisa diakses dari browser, tetapi sebelumnya harus diaktifkan. Web server yang akan kita gunakan adalah Apache, berikut ini caranya
1. Install Apache

sudo apt install apache2 libapache2-mod-fcgid -y

2. Setting VHOST Smokeping
Buat file virtual host untuk konfigurasi Smokeping di Apache pada file /etc/apache2/conf-enabled/smokeping.conf, yang isinya

Alias /smokeping/cache /usr/local/smokeping/cache
Alias /smokeping /usr/local/smokeping/htdocs/
 
 
<Directory "/usr/local/smokeping/cache">
  AllowOverride all
  Require all granted
</Directory>
 
<Directory "/usr/local/smokeping/htdocs/">
 Options FollowSymLinks ExecCGI
 AllowOverride all
 Require all granted
</Directory>

3. Aktifkan CGI dan restart Apache

sudo a2enmod cgi
# restart apache
sudo systemctl restart apache2

4. Set permission
Set permission agar apache bisa mengakses file Smokeping

sudo chown www-data:www-data -R /usr/local/smokeping

5. Akses Web UI Smokeping
Buka link http://IP-SERVER/smokeping/smokeping.fcgi.dist
smokeping di browser

Leave a comment

Your email address will not be published. Required fields are marked *