1.關閉selinux,建議修改完后即時重啟reboot。避免太多防火牆的限制麻煩。 vi /etc/selinux/config SELINUX=disabled :wq!
2.設置時間並同步
hwclock
hwclock --set --date "2018-02-5 14:47:30"
hwclock --hctosys
clock -w
history
3.修改支持中文輸入
vi /etc/locale.conf
LANG="zh_CN.UTF-8" reboot 4.修改yum源 yum install wget -y rm -rf /etc/yum.repos.d/* wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo yum clean all yum makecache 5.安裝lrzsz上傳軟件 yum -y install lrzsz 6.上傳已下載好的echoping-6.0.2.tar.gz、smokeping-2.6.11.tar.gz、fping-4.0.tar.gz、config(smokeping配置模板)
7.快速安裝以下軟件 yum groupinstall "Compatibility libraries" "Base" "Development tools" -y
8.安裝fping-4.0
tar -zxvf fping-4.0.tar.gz
cd fping-4.0
./configure
make && make install
9.快速安裝以下軟件集
yum -y install cpan perl perl-FCGI perl-CGI perl-Digest-HMAC perl-Net-Telnet perl-Net-OpenSSH perl-Net-SNMP perl-LDAP perl-Net-DNS perl-IO-Pty-Easy perl-Test-Simple perl-Sys-Syslog perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl httpd httpd-devel gcc make wget libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel mod_fcgid screen popt-devel openssl openssl-devel wqy-zenhei-fonts
10.安裝配置echoping-6.0.2
tar xvf echoping-6.0.2.tar.gz
cd echoping-6.0.2
./configure --prefix=/usr/local/echoping --with-ssl --without-libidn
make
make install
11.安裝配置smokeping-2.6.11
tar -xvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
export PERL5LIB=/usr/local/smokeping/thirdparty/lib/perl5/
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
gmake install
cd /usr/local/smokeping
mkdir cache data var
touch /var/log/smokeping.log
chown apache.apache cache/ data/ var/ /var/log
12.創建相關配置文件
cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
cp ~/config /usr/local/smokeping/etc/config 復制smokeping配置模板到指定配置目錄
13.修改字體支持中文
vim /usr/local/smokeping/lib/Smokeping/Graphs.pm
/for my 按n查找
for my $host (@hosts){
my ($graphret,$xs,$ys) = RRDs::graph
("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],
'--font TITLE:20"WenQuanYiZen Hei Mono"',
14.修改apache配置文件增加登錄驗證
htpasswd -c /usr/local/smokeping/htdocs/htpasswd smokeping
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
15.修改httpd.conf增加smokeping的web界面
vim /etc/httpd/conf/httpd.conf
IncludeOptional conf.d/*.conf
#########changed by jack 2016/11/02##############
Alias /cache "/usr/local/smokeping/cache/"
Alias /cropper "/usr/local/smokeping/htdocs/cropper/"
Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"
<Directory "/usr/local/smokeping">
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
AllowOverride AuthConfig
Order allow,deny
Allow from all
AuthName "Smokeping"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>
16.刪除firewalld,並安裝配置iptables服務
systemctl stop firewalld.service
systemctl disable firewalld.service
yum install iptables-services -y
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
:wq!
systemctl start iptables.service
systemctl enable iptables.service
17.啟動服務
systemctl start httpd
systemctl enable httpd
netstat -lntup |grep 80
/usr/local/smokeping/bin/smokeping
輸入用戶名smokeping,密碼為你初始化的密碼即可。