OpenBSD - Smokeping
Page content
How to Install Smokeping on OpenBSD
Requiremens
- running Server with OpenBSD
- Root Permission
- FQDN with Cert
Install Software
pkg_add smokeping
Update Config
cat << 'EOF' >/etc/smokeping/config
*** General ***
owner = YOUR NAME
contact = [email protected]
mailhost = localhost
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed ... this is not
# good for images.
imgcache = /var/www/htdocs/smokeping/cache
imgurl = cache
datadir = /var/db/smokeping
piddir = /var/run
cgiurl = https://YOUR.URL.NET/smokeping/smokeping.cgi
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no
*** Alerts ***
to = [email protected]
from = smokealert@localhost
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
*** Database ***
step = 300
pings = 20
# consfn mrhb steps total
AVERAGE 0.5 1 28800
AVERAGE 0.5 12 9600
MIN 0.5 12 9600
MAX 0.5 12 9600
AVERAGE 0.5 144 2400
MAX 0.5 144 2400
MIN 0.5 144 2400
*** 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 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
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
*** Probes ***
+ FPing
binary = /usr/local/sbin/fping
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing
+ Remote
menu= Remote
title= Remote hosts
+ DNS
menu = DNS
title = DNS
++ cf
menu = 1.1.1.1
title = 1.1.1.1
host = 1.1.1.1
++ google
menu = 8.8.8.8
title = 8.8.8.8
host = 8.8.8.8
++ quad9
menu = 9.9.9.9
title = 9.9.9.9
host = 9.9.9.9
EOF
Create Folders
don’t like to set permission to 777. but it does not work without :(
mkdir -p /var/www/htdocs/smokeping/cache
chown _smokeping /var/www/htdocs/smokeping/cache
chmod 777 /var/www/htdocs/smokeping/cache
Configure httpd
cat << 'EOF' >> /etc/httpd.conf
# Smokeping
server "your.server.net" {
listen on * 80
listen on * tls port 443
tls {
certificate "/etc/ssl/path/to/your/server.crt"
key "/etc/ssl/path/to/your/private.key"
}
location "/smokeping/smokeping.cgi*" {
fastcgi socket "/run/smokeping.sock"
root "/"
}
}
EOF
Update FW Rules
pass in log quick inet proto tcp from any to (self) port { 80 443 }
pass in log quick inet6 proto tcp from any to (self) port { 80 443 }
enable & start services
rcctl enable smokeping smokeping_fcgi httpd
rcctl restart smokeping smokeping_fcgi httpd
install xfonts
if xfonts are not installed, you will not get the text on the rrd graphs
ver=$(uname -r |sed 's/\.//')
cd /tmp
ftp https://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/$(uname -p)/xfont${ver}.tgz
tar -C / -xzphf xfont${ver}.tgz
and your Smokeping should build graphs after 5 minutes …
Any Comments ?
sha256: ba3a9ddb9256e5478a977db65fd64e69263b2558a2af1fb775a58184a3f51a85