下载软件源
http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
http://mirrors.zju.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm
[root@localhost ~]# yum -y install http://mirrors.zju.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm
[root@localhost ~]# yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
[root@localhost ~]# yum makecache
安装smokeping依赖软件包
[root@localhost ~]# yum -y install mod_fcgid httpd httpd-devel rrdtool fping wget curl bind-utils gcc make
[root@localhost ~]# yum -y install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-RRD-Simple perl-ExtUtils-MakeMaker
解压缩并安装
[root@localhost ~]# mkdir -p /opt/smokeping/{data,var,cache}
[root@localhost ~]# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
[root@localhost ~]# tar xzf smokeping-2.6.11.tar.gz
[root@localhost ~]# cd smokeping-2.6.11/setup/
[root@localhost setup]# ./build-perl-modules.sh
[root@localhost setup]# cp -r ../thirdparty/ /opt/smokeping/
[root@localhost setup]# cd ..
[root@localhost smokeping-2.6.11]# ./configure –prefix=/opt/smokeping
[root@localhost smokeping-2.6.11]# make install
安装启动脚本
[root@localhost smokeping-2.6.11]# wget http://new.wedebugyou.com/static/smokeping_start_stop.txt
[root@localhost smokeping-2.6.11]# mv smokeping_start_stop.txt /etc/init.d/smokeping
[root@localhost smokeping-2.6.11]# chmod 755 /etc/init.d/smokeping
更改文件权限并修改主配置文件
[root@localhost smokeping-2.6.11]# cd /opt/smokeping/etc/
[root@localhost etc]# ll smokeping_secrets.dist
-rw-r–r–. 1 root root 59 Mar 20 03:49 smokeping_secrets.dist
[root@localhost etc]# chmod 600 smokeping_secrets.dist
[root@localhost etc]#
[root@localhost etc]# cp config.dist config
[root@localhost etc]# vi config
#cgiurl = http://some.url/smokeping.cgi
cgiurl = http://192.168.150.79/smokeping/smokeping.cgi
#host = james.address
host = www.baidu.com
修改权限允许Apache读写操作
[root@localhost etc]# cd ..
[root@localhost smokeping]# ln -s /opt/smokeping/cache /opt/smokeping/htdocs/cache
[root@localhost smokeping]# chown -R apache cache
[root@localhost smokeping]# chown -R apache data
增加Apache配置文件
[root@localhost smokeping]# cd /etc/httpd/conf.d/
[root@localhost conf.d]# vi smokeping.conf
ScriptAlias /smokeping/smokeping.cgi /opt/smokeping/htdocs/smokeping.fcgi.dist
Alias /smokeping /opt/smokeping/htdocs
<Directory “/opt/smokeping/htdocs”>
Options FollowSymLinks
</Directory>
启动Smokeping服务器和Apache服务器
[root@localhost ~]# service smokeping start
Starting SMOKEPING: Note: logging to syslog as local0/info.
Daemonizing /opt/smokeping/bin/smokeping …
[ OK ]
[root@localhost ~]#
[root@localhost ~]# service httpd start
错误分析:权限
修改为600仅限所有者操作,修改所有者为apache允许Slave通过API操作
[root@localhost ~]# chkconfig –add smokeping
[root@localhost ~]# service smokeping start
Starting SMOKEPING: ERROR: /opt/smokeping/bin/../etc/config, line 112: File ‘/opt/smokeping/etc/smokeping_secrets.dist’ is world-readable or writable, refusing it
[FAILED]
[root@localhost ~]#
错误分析:权限
slave在master缩略图中不显示的问题
[root@localhost ~]# ll /opt/smokeping/data/Test/
total 23360
-rw-r–r–. 1 root root 2986808 Mar 20 07:19 Baidu~boomer.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 08:15 Baidu.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 08:15 FtiaoCT.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 08:15 FtiaoCU.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 04:06 James~boomer.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 06:43 James.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 04:06 James~slave2.rrd
-rw-r–r–. 1 root root 2986808 Mar 20 08:15 Sina.rrd
[root@localhost ~]# chown -R apache /opt/smokeping/data/