Centos系统下搭建Smokeping 方法

安装前的准备:

(1) yum -y  install lrzsz

(2) ntpdate time.nist.gov

(3)  vi /etc/resolv.conf

(4) 关闭SElinux   

   setenforce 0  临时关闭

   vi /etc/sysconfig/selinux  

    SELINUX=permissive  

    getenforce    # 查看 SElinux的命令 

    Permissive  ##返回的记过是Permissive,表示已经关闭 SElinux

(5)yum -y install libxml2-devel libpng-devel glib pango pango-devel freetypefreetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel perl perl-Net-Telnet perl-Net-DNSperl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI rrdtool-perl

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  popt-devel

yum -y install  perl-devel

(6) 上传安装包

(7)tar zxvf cgilib-0.5.tar.gz

cd  cgilib-0.5

 make

 cp libcgi.a /usr/local/lib

cp cgi.h /usr/include

tar zxvf fping-2.4b2_to.tar.gz

cd fping-2.4b2_to

./ configure

make

make install

tar zxvf popt-1.14.tar.gz

cd popt-1.14

./ configure

make && make install

tar zxvf libidn-0.5.20.tar.gz

cd libidn-0.5.20

./ configure

make && make install

tar zxvf echoping-6.0.2.tar.gz

cd echoping-6.0.2

. / configure

make && make install

tar zxvf smokeping-2.6.8.tar.gz

cd smokeping-2.6.8

./ configure -prefix= /usr/local/smokeping

./ setup /build-perl-modules.sh /usr/local/smokeping/thirdparty

 

./ configure -prefix= /usr/local/smokeping

gmake install

/usr/local/smokeping

进入htdocs 目录

# mv smokeping.fcgi.dist   smokeping.fcgi

进入etc目录

cp  config.dist config

修改config文件

# vim config

以下自行修改为自己需要的

+FPing

binary=  /usr/sbin/fping  ##修改为实际路径

binary= /usr/local/sbin/fping

***** Presentation*****

charset= UTF-8

创建存放数据文件的目录

mkdir  /usr/local/smokeping/data /usr/local/smokeping/var /usr/local/smokeping/cache

修改smokeping的目录为apache 运行用户的属主 、组

chown -R daemon.daemon  smokeping /

chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

chmod -R 777 /usr/local/smokeping/cache /usr/local/smokeping/data /usr/local/smokeping/var

  创建smokeping的log文件

touch /var/log/smokeping.log

chown daemon.daemon /var/log/smokeping.log

#vim /etc/httpd/conf/httpd.conf

listen 8080

Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"

  Alias /cache  "/usr/local/smokeping/cache"

 Alias  /copper  " /usr/local/smokeping/htdocs/cropper/"

  <Directory /usr/local/smokeping>

     AllowOverride  None

     AddHandler cgi-script cgi fcgi

Options  ExecCGI

  Order allow , deny

Allow from all

DirectoryIndex smokeping.cgi

</Directory>

启动 smokeping

perl  /usr/local/smokeping/bin/smokeping  --logfile=/var/log/smokeping.log

启动httpd服务并设置httpd开机启动及关闭防火墙

/etc/init.d/httpd start  #启动httpd服务或者 service httpd  start

chkconfig httpd on # 开机启动httpd 进程

service iptables stop  #关闭防火墙

chkconfig iptables  off#开机不启动iptables服务

echo "fzlt:smokeping123">  /usr/local/smokeping/etc/smokeping_secrets.dist

从服务器需要设置: chmod 600 /usr/local/smokeping/etc/slave_secret.txt

 

 

 

   

posted @ 2016-01-20 13:48  felix1225  阅读(592)  评论(1编辑  收藏  举报