Zero's Blog

Centos7安装smokeping

I am using Centos7 + smokeping-2.6.9 lets start up by install needed package before that, we will need to enable Epel repo You can install EPEL by running yum install epel-release. The package is included in the CentOS Extras repository, enabled by default.

install epel

1
yum install epel-release

Then follow up by the package for:

  • mod_fcgid
  • httpd
  • httpd-devel
  • rrdtool
  • perl-CGI-SpeedyCGI
  • fping
  • rrdtool-perl
  • perl
  • perl-Sys-Syslog
1
yum install mod_fcgid httpd httpd-devel rrdtool perl-CGI-SpeedyCGI fping rrdtool-perl perl perl-Sys-Syslog

install perl modules

Then we will needed some package for Cpan to install perl stuff

1
yum install perl-CPAN perl-local-lib perl-Time-HiRes

The last one is the package to create installation for smokeping

1
# yum groupinstall "Development tools"

install smokeping

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
\\ Now lets download the latest smokeping at http://oss.oetiker.ch/smokeping/pub currently the latest i saw is 2.6.9, so i just download that
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.9.tar.gz
\\ then extract it
tar -zxvf smokeping-2.6.9.tar.gz
\\ Install the smokeping perl stuff
cd smokeping-2.6.9/setup
./build-perl-modules.sh
\\ it will auto install needed perl
\\ Once done, back to smokeping-2.6.9 folder and you will notice a folder name thirdparty is created
\\ we will need to move it to /usr/local/smokeping folder, but before that, lets create smokeping folder at /usr/local/smokeping first
\\ then copy the thirdparty folder into it
mkdir /urs/local/smokeping
cp -r thirdparty /usr/lcoal/smokeping/
./configure --prefix=/usr/local/smokeping PERL5LIB=/usr/lib64/perl5/
make
make install

Note: if you encounter problem, please try make install again
this is because for my situation when i first make install, it pop some error but when i try make install again, the error gone

Now you can go to /usr/local/smokeping/etc and prepare the config file

install httpd

Now is time to prepare for the interface make sure you had install apache else please install it using yum install httpd

1
yum install httpd -y

smokeping config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
cd /usr/local/smokeping/etc
for foo in *.dist; do cp $foo `basename $foo .dist`; done
mv /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
\\edit smokeping.conf
vim /etc/httpd/conf.d/smokeping.conf
Alias /ping /usr/local/smokeping/htdocs/
DirectoryIndex index.html smokeping.fcgi
Options +ExecCGI
#AllowOverride None
AddHandler cgi-script .cgi .fcgi
Order allow,deny
Allow from all
AuthName "Smokeping Access"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd.user
Require valid-user
chmod 600 /usr/local/smokeping/etc/smokeping_secrets
mkdir -p /usr/local/smokeping/htdocs/cache
mkdir /usr/local/smokeping/data
mkdir /usr/local/smokeping/var
chown nobody:nobody /usr/local/smokeping/var
chown nobody:nobody /usr/local/smokeping/data
chown nobody:nobody /usr/local/smokeping/htdocs/cache
\\Before we start smokeping, please edit your configuration first edit the smokeping config to your need (change the part in Red color word
vim /usr/local/smokeping/etc/config
*** General ***
owner = Charlie.cui
contact = some@address.nowhere
mailhost = my.mail.host (Ignore if you do not have smtp server)
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 = /usr/local/smokeping/cache
imgurl = cache
datadir = /usr/local/smokeping/data
piddir = /usr/lcoal/smokeping/var
cgiurl = http://some.url/smokeping.cgi
smokemail = /usr/local/smokeping/etc/smokemail.dist
tmail = /usr/local/smokeping/etc/tmail.dist
# 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 = alertee@address.somewhere
from = smokealert@company.xy
+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 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
+ 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 400 Days" 400d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
*** Probes ***
+ FPing
binary = /usr/sbin/fping
*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
color=0000ff
+slave2
display_name=another
color=00ff00
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
Here you will learn all about the latency of our network.
+ Server
menu= Targets
++ google
menu = google.com
title = google.com
alerts = someloss
host = www.google.com

Start the apache service

1
systemctl start httpd

start the smokeping services

1
/usr/local/smokeping/bin/smokeping --config=/usr/local/smokeping/etc/config --logfile=/var/log/smokeing.log

For startup script

you can get it from here

1
2
3
wget http://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script
\\ just edit the smokeping path then put at /etc/init.d/
chmod 755 /etc/init.d/smokeping