测试环境 CentOS 7.8
安装依赖包
#yum install -y open-vm-tools
#yum install -y open-vm-tools-desktop
#yum update
#yum install -y net-tools ntp ntpdate
#yum install -y rrdtool perl-rrdtool openssl-devel
#yum install -y perl-core
安装smokeping
#cd /opt
#tar zxvf smokeping-2.7.3.tar.gz
#cd smokeping-2.7.3
#cp -r thirdparty /opt/smokeping/
#./configure --prefix=/opt/smokeping
#/usr/bin/gmake install
安装fping
#cd /opt
#tar zxvf fping-5.0.tar.gz -C /opt
#make && make install
安装echoping
#cd /opt
#tar zxvf echoping-6.0.2.tar.gz
#cd echoping-6.0.2
#yum install -y popt-devel
# ./configure --prefix=/usr/local/echoping --with-ssl --without-libidn
#make && make install
#yum install -y dig-utils httpd httpd_devel
#vim /etc/httpd/conf/httpd.conf
将语句改为 ServerName localhost:80
#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
#vi /opt/smokeping/etc/config
*** General ***
owner = domain
contact = [email protected]
mailhost = smtp.mxhichina.com
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/smokeping/cache
imgurl = cache
datadir = /var/www/smokeping/data
piddir = /opt/smokeping/var
cgiurl = http://10.8.1.35/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail.dist
tmail = /opt/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 = [email protected]
from = [email protected]
+hostdown
type = loss
pattern = ==0%,==0%,==0%,==U
comment = no reply
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
*** Database ***
step = 60
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 ***
charset = UTF-8
template = /opt/smokeping/etc/basepage.html.dist
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 400 Days" 400d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
slave内容全删除
*** Probes ***
+ FPing
binary = /usr/local/sbin/fping
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Hello World!
+ Test
menu = Targets
title = VPN-Link
++ xian-50M
menu = test
title = test
alerts = someloss,hostdown
host = 1.1.1.1
Multihost内容全删除
--------------------
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
-----------------
vim /etc/httpd/conf.d/smokeping.conf
Alias /smokeping "/var/www/smokeping"
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
Order allow,deny
Allow from all
AuthName "Smokeping"
AuthType Basic
AuthUserFile /opt/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
创建admin账户
htpasswd -cd /opt/smokeping/htdocs/htpasswd admin
重启服务及应用
#setenforce 0
#firewall-cmd --add-service=http
#firewall-cmd --add-service=https
#firewall-cmd --runtime-to-permanent
#setsebool -P httpd_can_network_connect 1
#systemctl start httpd && systemctl enable httpd
#systemctl start smokeping && systemctl enable smokeping