且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Centos5.5下Smokeping安装配置

更新时间:2022-10-05 20:14:45

 1、修改163源,并添加rrdtool源:


  1. cd /etc/yum.repos.d/ 
  2. mv CentOS-Base.repo CentOS-Base.repo.bak 
  3. wget http://mirrors.163.com/.help/CentOS-Base-163.repo 
  4. mv  CentOS-Base-163.repo   CentOS-Base.repo 
  5. echo >> CentOS-Base.repo < "EOF" 
  6. [dag]   
  7. name=Dag RPM Repository for Red Hat Enterprise Linux   
  8. baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag   
  9. gpgcheck=1  
  10. gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt   
  11. enabled=1  
  12. EOF 
  13. /usr/bin/yum makecache 

2、安装Apache:


  1. yum –y install openssl* 
  2. tar jxvf httpd-2.2.21.tar.bz2 
  3. cd httpd-2.2.21 
  4. ./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl --enable-rewrite --enable-deflate 
  5. make && make install 

3、安装rrdtool相关:


  1. yum -y install libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel rrdtool* 

4、安装cgilib:


  1. wget http://down1.chinaunix.net/distfiles/cgilib-0.5.tar.gz 
  2. tar zxvf cgilib-0.5.tar.gz 
  3. cd cgilib-0.5 
  4. make 
  5. cp libcgi.a /usr/local/lib 
  6. cp cgi.h /usr/include 

5、安装fping:


  1. wget http://fping.sourceforge.net/download/fping.tar.gz 
  2. tar zxvf fping.tar.gz 
  3. cd fping-2.4b2_to 
  4. ./configure 
  5. make 
  6. make check 
  7. make install 

6、安装echoping:


  1. wget http://jaist.dl.sourceforge.net/project/echoping/echoping/6.0.0/echoping-6.0.0.tar.gz 
  2. tar zxvf echoping-6.0.0.tar.gz  
  3. cd echoping-6.0.0 
  4. ./configure --without-libidn 
  5. make 
  6. make install 

7、安装FCGI:


  1. wget http://cpan.communilink.net/authors/id/F/FL/FLORA/FCGI-0.74.tar.gz 
  2. tar zxvf FCGI-0.74.tar.gz  
  3. cd cd FCGI-0.74 
  4. perl Makefile.PL  
  5. make && make install 

8、安装Apache Dso 扩展:


  1. wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz 
  2. tar zxvf mod_fastcgi-2.4.6.tar.gz 
  3. cd mod_fastcgi-2.4.6 
  4. /usr/local/apache2/bin/apxs -o mod_fastcgi.so -c *.c 
  5. /usr/local/apache2/bin/apxs -i -a -n fastcgi .libs/mod_fastcgi.so 
  6. 修改apache配置文件 :确认有如下一行,没有则添加 
  7. LoadModule fastcgi_module modules/mod_fastcgi.so 

9、安装Smokeping:


  1. wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.6.tar.gz 
  2. tar zxvf tar zxvf smokeping-2.6.6.tar.gz 
  3. cd smokeping-2.6.6 
  4. ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty 
  5. ./configure --prefix=/usr/local/smokeping 
  6. gmake install 

 

10、Smokeping配置:


  1. vi /usr/local/smokeping/bin/smokeping 
  2. 第八行:use lib qw(); # PERL5LIB 
  3. 修改为:use lib qw(/usr/lib/perl5); 
  4.  
  5. cd /usr/local/smokeping/htdocs 
  6. mv smokeping.fcgi.dist smokeping.fcgi 
  7.  
  8. cd ../etc 
  9. cp config.dist config 
  10. owner    =  
  11. contact  =  
  12. mailhost =  
  13. 上面这三个填写联系人,先随便弄弄 
  14.  
  15. cgiurl   = http://192.168.1.101/smokeping.cgi 
  16. 这段是Smokeping的网站地址 
  17.  
  18. + FPing 
  19. binary = /usr/local/sbin/fping 
  20. 这里修改为本机的FPing的地址 
  21.  
  22. 创建存放数据文件的目录: 
  23. mkdir /usr/local/smokeping/data /usr/local/smokeping/var /usr/local/smokeping/cache 
  24. chown -R daemon.daemon smokeping/ 
  25. chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist 
  26. touch /var/log/smokeping.log 
  27. chown daemon.daemon /var/log/smokeping.log 
  28.  
  29. 启动smokeping 
  30. perl /usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 
  31.  
  32. 最后Apache加入一个虚拟目录: 
  33. 最后加入 
  34. Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi" 
  35. Alias /cache "/usr/local/smokeping/cache" 
  36. Alias /cropper "/usr/local/smokeping/htdocs/cropper/" 
  37. <Directory /usr/local/smokeping> 
  38. AllowOverride None 
  39. AddHandler cgi-script cgi fcgi 
  40. Options ExecCGI 
  41. Order allow,deny 
  42. Allow from all 
  43. Require valid-user 
  44. </Directory> 

11、添加被监控机:


  1. *** Targets ***  
  2.   
  3. probe = FPing  
  4.   
  5. menu = Top  
  6. title = Network Latency Grapher  
  7. remark = Welcome to the SmokePing website of xxx Company. \  
  8.          Here you will learn all about the latency of our network.  
  9.   
  10. + lihuipeng  
  11. menu=  lihuipeng  
  12. title =  lihuipeng  
  13. #parents = owner:/Test/James location:/  
  14.   
  15. ++ test1  
  16. menu = 192.168.1.102  
  17. title =192.168.1.102  
  18. host = 192.168.1.102  

然后重启Smokeping!~

本文转自运维笔记博客51CTO博客,原文链接http://blog.51cto.com/lihuipeng/1040575如需转载请自行联系原作者


lihuipeng