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

 

 

 

   

转载于:https://www.cnblogs.com/felix1225/p/5144935.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值