CentOS 6.5搭建Smokeping平台(上)

前端之家收集整理的这篇文章主要介绍了CentOS 6.5搭建Smokeping平台(上)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、添加EPEL和RPMForge第三方源

如果是i686平台:

  1. rpm-ivhhttp://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  2. rpm-ivhhttp://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

如果是x86_64平台:

  1. rpm-ivhhttp://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  2. rpm-ivhhttp://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm


2、安装rrdtool与依赖库

  1. yum-yinstallperlperl-Net-Telnetperl-Net-DNSperl-LDAPperl-libwww-perlperl-RadiusPerlperl-IO-Socket-SSLperl-Socket6perl-CGI-SpeedyCGIperl-FCGIperl-CGI-SpeedCGIperl-Time-HiResperl-ExtUtils-MakeMakerperl-RRD-Simplerrdtoolrrdtool-perlcurlfpingechopinghttpdhttpd-develgccmakewgetlibxml2-devellibpng-develglibpangopango-develfreetypefreetype-develfontconfigcairocairo-devellibart_lgpllibart_lgpl-develmod_fastcgiscreen


3、下载与安装smokeping

  1. wgethttp://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
  2. tar-zxvfsmokeping-2.6.11.tar.gz
  3. cdsmokeping-2.6.11
  4. ./setup/build-perl-modules.sh/usr/local/smokeping/thirdparty
  5. ./configure--prefix=/usr/local/smokeping
  6. /usr/bin/gmakeinstall

注:解决“checking checkingfor perl module ‘RRDS’…Failed”的问题

如果是编译安装的rrdtool,所以perl没找到默认路径下它的模块,需要手工拷贝过去。

先搜素 find / -name RRDs.pm

cp xxx/xxx/RRDs.pm /usr/lib/perl5/

cp xxx/xxx/RRDs.so /usr/lib/perl5/

若是64位的服务器,则cp to /usr/lib64/perl5/


4、配置smokeping

1)创建cache、data、var目录

  1. mkdir-p/usr/local/smokeping/cache/usr/local/smokeping/data/usr/local/smokeping/var

2)创建日志文件

  1. touch/var/log/smokeping.log

3)授权

  1. chownapache:apachecachedatavar
  2. chownapache:apache/var/log/smokeping.log

4)修改配置文件

  1. cd/usr/local/smokeping/htdocs/
  2. mvsmokeping.fcgi.distsmokeping.fcgi
  3. cd/usr/local/smokeping/etc
  4. mvconfig.distconfig
  5. vimconfig
  6. cgiurl=http://XXX.XXX.53.223/smokeping.cgi
  7. charset=utf-8

5)修改密码文件权限

  1. chmod600/usr/local/smokeping/etc/smokeping_secrets.dist

6)修改apache的配置

  1. vim/etc/httpd/conf/httpd.conf
  2. DocumentRoot"/var/www/html"
  3. Alias/cache"/usr/local/smokeping/cache/"
  4. Alias/cropper"/usr/local/smokeping/htdocs/cropper/"
  5. Alias/smokeping"/usr/local/smokeping/htdocs/smokeping.fcgi"
  6. <Directory"/usr/local/smokeping">
  7. AllowOverrideNone
  8. OptionsAll
  9. AddHandlercgi-script.fcgi.cgi
  10. Orderallow,deny
  11. Allowfromall
  12. DirectoryIndexsmokeping.fcgi
  13. </Directory>

7)开机启动与安全策略

  1. echo"/usr/local/smokeping/bin/smokeping--logfile=/var/log/smokeping.log2>&1&">>/etc/rc.local
  2. chkconfighttpdon
  3. iptables-tfilter-IINPUT-ptcp--dport80-jACCEPT
  4. setenforce0


5、测试验证

wKiom1mJf_nRG49GAACcie8zYzs280.png-wh_50

猜你在找的CentOS相关文章