rpm -Uvh http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
2、yum安装环境
yum -y install gcc gcc-* make man file vim-enhanced openssh-clients lftp ftp wget curl elinks httpd httpd-devel expect ntp pango system-config-network-tui libxml2-devel libpng-devel pango pango-devel libart_lgpl libart_lgpl-devel freetype freetype-devel fontconfig cairo cairo-devel sendmail
yum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI
yum install fping echoping
3、安装rrdtool
wget http://bcs.duapp.com/xiueli/rrdtool.tar.gz
tar zxvf rrdtool.tar.gz
mv rrdtool /usr/local/
ln /usr/local/rrdtool/bin/rrdtool /usr/bin
#这个包的rrdool是1.4.5的已经编译好的
/usr/local/rrdtool/bin/rrdtool #可以查看版本
4、安装smokeping
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz
tar zxvf smokeping-2.4.2.tar.gz
mv smokeping-2.4.2 /usr/local/smokeping
5、配置smokeping (这步是搭建smokeping最难的了)
cp /usr/local/smokeping/bin/smokeping.dist /usr/local/smokeping/bin/smokeping
cp /usr/local/smokeping/htdocs/smokeping.cgi.dist /usr/local/smokeping/htdocs/smokeping.cgi
mkdir -p /usr/local/smokeping/htdocs/img
mkdir -p /usr/local/smokeping/var
vim /usr/local/smokeping/bin/smokeping
内容如下
#!/usr/bin/perl -w
# -*-perl-*-
use lib qw(/usr/local/rrdtool/lib/perl/); #需要更改
use lib qw(/usr/local/smokeping/lib/); *需要更改
use strict;
use warnings;
use Smokeping 2.004002;
Smokeping::main("/usr/local/smokeping/etc/config.dist"); #需要更改
vim /usr/local/smokeping/htdocs/smokeping.cgi
#更改,还是上面那三处
#!/usr/bin/speedy
# -*-perl-*-
use strict;
use warnings;
use lib qw(/usr/local/rrdtool/lib/perl/);
use lib qw(/usr/local/smokeping/lib/);
use CGI::Carp qw(fatalsToBrowser);
use Smokeping 2.004002;
Smokeping::cgi("/usr/local/smokeping/etc/config.dist");
最重要的config.dist配置
见http://www.yinxiulei.cn/smokeping配置文件.html
6、设置登录密码
htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin
7、apache配置
vi /etc/httpd/conf.d/smkeping.conf
#加入下面内容
ServerAdmin 627526297@qq.com
DocumentRoot "/usr/local/smokeping/htdocs"
ServerName localhost
Options FollowSymLinks ExecCGI
AllowOverride None
AddHandler cgi-script cgi
Order allow,deny
Allow from all
AuthName "Smokeping"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
ErrorLog logs/smokeping-error_log
CustomLog logs/smokeping-access_log combined
三、启动服务器
/etc/init.d/httpd start
/usr/local/smokeping/bin/smokeping start
如正常启动打开网站
http://ip/smokeping/smokeping.cgi
ps问题解决
smokeping无图图片叉叉,检查配置文件中的imgcache
看imgcache目录内是否有数据,目录是否在htdocs内