参考:
http://www.aclstack.com/454.html
https://blog.lianst.com/cento7an-zhuang-pei-zhi-smokepingjian-kong-wang-luo-zhi-liang/
http://blog.csdn.net/reblue520/article/details/53010864
操作系统:Cento7
1.安装第三方epel源
wget http://dl.lianst.com/rpm/epel/epel-release-7-9.noarch.rpm
rpm -ivh epel-release-7-9.noarch.rpm
2.安装依赖包
yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 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 popt popt-devel libidn libidn-devel
3.安装fping
# 使用yum安装
yum -y install fping
# 编译安装
wget http://dl.lianst.com/rpm/smokeping/fping-4.0.tar.gz
tar -zxvf fping-4.0.tar.gz
cd fping-4.0
./configure
make && make install
4.安装echoping
wget http://dl.lianst.com/rpm/smokeping/echoping-6.0.2.tar.gz
tar -zxvf echoping-6.0.2.tar.gz
cd echoping-6.0.2
./configure
make && make install
smokeping安装配置
1.编译安装smokeping
wget http://dl.lianst.com/rpm/smokeping/smokeping-2.6.11.tar.gz
tar -zxvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
./configure --prefix=/usr/local/smokeping
或则
/usr/bin/gmake install2.配置smokeping
更改配置文件
vim /usr/local/smokeping/etc/config
修改如下内容:
cgiurl = http://10.0.0.62/smokeping.cgi
*** Database ***
step = 60 #此处建议改为 60 , 一分钟采集一次数据
pings = 20
apache安装及配置
1.使用yum安装httpd
yum -y install httpd
2.编辑apache配置文件
vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"下添加如下代码:
DocumentRoot "/var/www/html"
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
Order allow,deny
Allow from all
AuthName "Smokeping" //开启认证
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd //认证文件
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>
3.创建认证文件
htpasswd -bc htpasswd user password
4.重载apahce
systemctl restart httpd
至此,你就可以通过http://ip地址/smokeping 访问smokeping了。
页面中文乱码处理
1.安装字体
yum -y install wqy-zenhei-fonts.noarch
2.编辑smokeping的配置文件
vim /usr/local/smokeping/etc/config
#第50行添加
charset = utf-8 #添加此行
3.编辑Graphs.pm
vim /usr/local/smokeping/lib/Smokeping/Graphs.pm
#第147行下边插入下边一行
'--font TITLE:20:"WenQuanYi Zen Hei Mono"',
smokeping启动脚本
代码就不贴了,直接使用下面地址下载就好了。 启动脚本下载地址:http://dl.lianst.com/rpm/smokeping/smokeping.sh