smokeping ,Centos 6 安装smokeping (最完整教程)
本教程需要的源码包一并上传了,届时可以直接上传到linux系统里面!
需要编译的fping、echoping、smokeping源码包,链接:https://pan.baidu.com/s/1i4X2uZr 提取码:k5s8 (20190114更新)
交流邮箱:openacl@foxmail.com
系统:centos 6.7
1、安装依赖包:
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
rz上传三个源码包(上文百度链接已包含)
2、解压、编译安装fping
tar xf fping-3.10.tar.gz
cd fping-3.10
./configure
make && make install
3、解压、编译安装echoping
tar xf echoping-6.0.2.tar.gz
cd echoping-6.0.2
./configure
make && make install
4、解压、编译安装smokeping
tar xf smokeping-2.6.9.tar.gz
cd smokeping-2.6.9
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
/usr/bin/gmake install
5、配置 smokeping
cd /usr/local/smokeping/
mkdir cache data var
touch /var/log/smokeping.log
chown apache:apache cache data var
chown apache:apache /var/log/smokeping.log
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
cd /usr/local/smokeping/htdocs
mv smokeping.fcgi.dist smokeping.fcgi
cd /usr/local/smokeping/etc
mv config.dist config
6、更改配置文件
vim /usr/local/smokeping/etc/config
主要修改如下内容:
#cgiurl = http://some.url/smokeping.cgi
cgiurl = http://10.0.0.62/smokeping.cgi
*** Database ***
#step = 300
step = 60 #此处建议改为 60 , 一分钟采集一次数据
pings = 20
7、编辑apache配置文件
vim /etc/httpd/conf/httpd.conf
最后边添加如下:
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
DirectoryIndex smokeping.fcgi
</Directory>
8、图像浏览界面的中文支持
安装字体
yum -y install wqy-zenhei-fonts.noarch
编辑smokeping的配置文件
vim /usr/local/smokeping/etc/config
第50行添加
charset = utf-8 #添加此行
编辑Graphs.pm
vim /usr/local/smokeping/lib/Smokeping/Graphs.pm
#第147行下边插入下边一行
'--font TITLE:20:"WenQuanYi Zen Hei Mono"',
9、##########测试数据可自定义##########
config 配置文件的最后边
vim /usr/local/smokeping/etc/config
+ Other
menu = 三大网络监控
title = 监控统计
++ dianxin
menu = 电信网络监控
title = 电信网络监控列表
host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-hlj
+++ dianxin-bj
menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133
+++ dianxin-hlj
menu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 219.147.198.242
++ liantong
menu = 联通网络监控
title = 联通网络监控列表
host = /Other/liantong/liantong-bj /Other/liantong/liantong-hlj /
+++ liantong-bj
menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121
+++ liantong-hlj
menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 202.97.224.69
++ yidong
menu = 移动网络监控
title = 移动网络监控列表
host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj
+++ yidong-bj
menu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52
+++ yidong-hlj
menu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.35
10、smokeping的默认配置文件110行的fping安装目录与此次安装目录不相符需修改!
vim /usr/local/smokeping/etc/config
#第110更改fping的目录为
binary = /usr/local/sbin/fping
11、启动apache和smokeping&设置环境变量
/etc/init.d/httpd start
/usr/local/smokeping/bin/smokeping
echo 'export PATH=/usr/local/smokeping/bin/:$PATH' >> /etc/profile