Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1175053
  • 博文数量: 150
  • 博客积分: 2739
  • 博客等级: 少校
  • 技术积分: 2392
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-07 12:28
文章分类

全部博文(150)

文章存档

2015年(2)

2014年(16)

2013年(10)

2012年(58)

2011年(64)

分类: 网络与安全

2013-07-18 15:30:27

Smokeping的配置

   Smokeping是网络性能监测工具并能绘制出图,让监控者可以清晰的看出当前网络状况。该工具也可以进行分布式测试,很好的东西。

1、安装Smokeping必要的组件
yum  install httpd rrdtool httpd-devel fping echoping curl -y  
yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-CPAN

2、下载安装smokeping
首先,wget 解压smokeping文件后,并不急着进行编译安装,要先安装cpanmm等模块,不然的会出现问题的
 ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty 安装模块或者用cpanm Module::Name手动安装

进行编译:
 ./configure --prefix=/usr/local/smokeping

进行编译时,出现以下问题以及解决方法:
出现: Can't locate ExtUtils/Embed.pm   解决: yum -y install perl-devel perl-ExtUtils-Embed

 出现:checking checking for perl module 'RRDs'... Failed  解决:  yum install rrdtool-perl

进行安装:
/usr/bin/gmake install

出现: world-readable or writable, refusing it    解决: chmod 711 /opt/smokeping/etc/secrets.conf

查看rrdtool的版本信息:
[root@www171 rrdtool-1.4.7]# /usr/local/rrdtool/bin/rrdtool -v
RRDtool 1.4.7  Copyright 1997-2012 by Tobias Oetiker
               Compiled Mar  5 2013 09:37:52

Usage: rrdtool [options] command command_options
Valid commands: create, update, updatev, graph, graphv,  dump, restore,
                last, lastupdate, first, info, fetch, tune,
                resize, xport, flushcached
RRDtool is distributed under the Terms of the GNU General
Public License Version 2. ()
For more information read the RRD manpages



编写smokeping配置文件信息:
##############################################

点击(此处)折叠或打开

  1. owner = Peter Random
  2. contact = some@address.nowhere
  3. mailhost = my.mail.host
  4. sendmail = /usr/sbin/sendmail #定义放送邮件
  5. # NOTE: do not put the Image Cache below cgi-bin
  6. # since all files under cgi-bin will be executed ... this is not
  7. # good for images.
  8. imgcache = /usr/local/smokeping/htdocs/cache #定义图片缓存目录
  9. imgurl = cache
  10. datadir = /usr/local/smokeping/data #定义数据存储目录
  11. piddir = /usr/local/smokeping/var #定义PID目录
  12. cgiurl = http://192.168.101.52/htdocs/smokeping.cgi #定义访问的URL
  13. smokemail = /usr/local/smokeping/etc/smokemail.dist
  14. tmail = /usr/local/smokeping/etc/tmail.dist
  15. # specify this to get syslog logging
  16. syslogfacility = local0
  17. # each probe is now run in its own process
  18. # disable this to revert to the old behaviour
  19. # concurrentprobes = no


  20. *** Alerts ***
  21. to = alertee@address.somewhere #定义发送到的邮箱
  22. from = smokealert@company.xy #定义放送着邮箱


  23. +someloss
  24. type = loss
  25. # in percent
  26. pattern = >0%,*12*,>0%,*12*,>0%
  27. comment = loss 3 times in a row


  28. *** Database ***


  29. step = 300 #300s
  30. pings = 20 #20数据包


  31. # consfn mrhb steps total


  32. AVERAGE 0.5 1 1008
  33. AVERAGE 0.5 12 4320
  34.     MIN 0.5 12 4320
  35.     MAX 0.5 12 4320
  36. AVERAGE 0.5 144 720
  37.     MAX 0.5 144 720
  38.     MIN 0.5 144 720


  39. *** Presentation ***


  40. template = /usr/local/smokeping/etc/basepage.html.dist


  41. + charts


  42. menu = Charts #定义抬头名称
  43. title = The most interesting destinations #定义抬头信息


  44. ++ stddev
  45. sorter = StdDev(entries=>4)
  46. title = Top Standard Deviation
  47. menu = Std Deviation
  48. format = Standard Deviation %f


  49. ++ max
  50. sorter = Max(entries=>5)
  51. title = Top Max Roundtrip Time
  52. menu = by Max
  53. format = Max Roundtrip Time %f seconds


  54. ++ loss
  55. sorter = Loss(entries=>5)
  56. title = Top Packet Loss
  57. menu = Loss
  58. format = Packets Lost %f


  59. ++ median
  60. sorter = Median(entries=>5)
  61. title = Top Median Roundtrip Time
  62. menu = by Median
  63. format = Median RTT %f seconds


  64. + overview


  65. width = 600
  66. height = 50
  67. range = 10h


  68. + detail


  69. width = 600
  70. height = 200
  71. unison_tolerance = 2


  72. "Last 3 Hours" 3h
  73. "Last 30 Hours" 30h
  74. "Last 10 Days" 10d
  75. "Last 400 Days" 400d


  76. #+ hierarchies
  77. #++ owner
  78. #title = Host Owner
  79. #++ location
  80. #title = Location


  81. *** Probes ***


  82. + FPing


  83. binary = /usr/local/sbin/fping #采用fping进行检测


  84. #*** Slaves *** #配置slave的信息
  85. #secrets=/usr/local/smokeping/etc/smokeping_secrets.dist #配置slave的密钥
  86. #+boomer
  87. #display_name=boomer
  88. #color=0000ff


  89. #+slave2
  90. #display_name=another
  91. #color=00ff00


  92. *** Targets ***


  93. probe = FPing


  94. menu = Top
  95. title = Network Latency Grapher
  96. remark = Welcome to the SmokePing website of xxx Company. \
  97.          Here you will learn all about the latency of our network.


  98. + Test
  99. menu= Targets
  100. #parents = owner:/Test/James location:/
  101. ++ Gavin32


  102. menu = Gavin32
  103. title =Gavin32
  104. #alerts = someloss
  105. #slaves = boomer slave2
  106. host = 192.168.101.32

  107. ##定义监控的机器

  108. ++ Gavin140


  109. menu = Gavin140
  110. title =Gavin140
  111. host = 192.168.101.140


  112. ++ Gavin161


  113. menu = Gavin161
  114. title =Gavin161
  115. host = 192.168.101.161




  116. ++ Gavin52


  117. menu = Gavin52
  118. title =Gavin52
  119. host = 192.168.101.52


  120. ++ Localhost


  121. menu = Localhost
  122. title =Localhost
  123. host = 127.0.0.1
  124. #############################################




编辑httpd.conf配置文件信息:

vim /etc/httpd/conf/httpd.conf
把 >AddHandler cgi-script cgi fcgi
改成 > AddHandler cgi-script .cgi
 Under
 把 > Options Indexes FollowSymLinks 
 改成 > Options Indexes FollowSymLinks ExecCGI




问题:
checking for poptGetContext in -lpopt... no
configure: error: Missing popt library, get it from ftp://ftp.rpm.org/pub/rpm/dist/rpm-x.y.z
popt安装:


403问题:
要是目录在/usr/local/smokeping而http.conf目录cgi指到/var/www/smokeping会出现这种情况(尤其是用links的时候)











阅读(5842) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~