设为首页 收藏本站
查看: 1476|回复: 0

[经验分享] smokeping config 详解

[复制链接]
发表于 2019-1-17 11:39:37 | 显示全部楼层 |阅读模式
  SmokePing之配置文件config详解
  这个配置文件不管在Linux下面还是在BSD下面是一致的。
  如下解说:
  整个config文件里面只有#注释
  第一部分 General 属于基本配置。值得注意的地方有imgcache和imgurl这两个参数,要注意一下,和apache配置相关联,如果配置不好的话,打开web的时候图片会显示不出来。
  *** General ***
  owner
     = test
  contact  =
  [email=***@sohu.com
  mailhost = smtp.sohu.com
  sendmail = /usr/sbin/sendmail
  # NOTE: do not put the Image Cache below cgi-bin
  # since all files under cgi-bin will be executed ... this is not
  # good for images.
  imgcache = /usr/local/smokeping/htdocs/img
  imgurl   = img
  datadir  = /usr/local/var/smokeping
  piddir  = /usr/local/var/smokeping
  cgiurl   =
  http://192.168.0.206/smokeping/smokeping.cgi
  smokemail = /usr/local/etc/smokeping/smokemail
  tmail = /usr/local/etc/smokeping/tmail
  # specify this to get syslog logging
  syslogfacility = local0
  # each probe is now run in its own process
  # disable this to revert to the old behaviour
  # concurrentprobes = no
  第二部分Alerts 是属于报警配置, 这个我还没有测试过。以后再说
  *** Alerts ***
  to =
  alertee@address.somewhere
  from =
  smokealert@company.xy
  +someloss
  type = loss
  # in percent
  #pattern = >0%,*12*,>0%,*12*,>0%
  #comment = loss 3 times  in a row
  pattern = ==S,>0%,>0%,>0%
  comment = loss at startup
  +rttdetect
  type = rtt
  # in milli seconds
  pattern = 100,>100,>100
  comment = routing mesed up again ?
  第三部分 Database  RRD数据库配置。step和pings这两个参数要在启动smokeping之前配置好,如果在smokeping启动后再配置这两个参数,需要把原来 的rrd文件都删除,然后再启动smokeping才可以。所以这个一定要先配置好。默认是step=300 pings=20  应该是每300s内执行20次ping的动作
  *** Database ***
  step     = 300
  pings    = 60
  # consfn mrhb steps total
  AVERAGE  0.5   1  1008
  AVERAGE  0.5  12  4320
     MIN  0.5  12  4320
     MAX  0.5  12  4320
  AVERAGE  0.5 144   720
     MAX  0.5 144   720
     MIN  0.5 144   720
  第四部分Presentation 是关于网络状态的一些配置和解释,基本不需要更改
  *** Presentation ***
  template = /usr/local/etc/smokeping/basepage.html
  charset = gb2312
  + charts
  menu = Charts
  title = The most interesting destinations
  ++ stddev
  sorter = StdDev(entries=>4)
  title = Top Standard Deviation
  menu = Std Deviation
  format = Standard Deviation %f
  ++ max
  sorter = Max(entries=>5)
  title = Top Max Roundtrip Time
  menu = by Max
  format = Max Roundtrip Time %f seconds
  ++ loss
  sorter = Loss(entries=>5)
  title = Top Packet Loss
  menu = Loss
  format = Packets Lost %f
  ++ median
  sorter = Median(entries=>5)
  title = Top Median Roundtrip Time
  menu = by Median
  format = Median RTT %f seconds
  下面的overview和detail里面是图片大小设置,可以按需来设置
  + overview
  width = 800
  height = 50
  range = 10h
  + detail
  width = 800
  height = 200
  unison_tolerance = 2
  "Last 3 Hours"    3h
  "Last 30 Hours"   30h
  "Last 10 Days"    10d
  "Last 400 Days"   400d
  + hierarchies
  ++ owner
  title = Host Owner
  ++ location
  title = Location
  第五部分Porbes 指针配置,我们一般只用到fping所以就只要以下配置就可以了,确定路径是否正确,这里还可以设置fping包的大小,参数是packetsize
  *** Probes ***
  + FPing
  binary = /usr/local/sbin/fping
  packetsize = 2000
  第六分部Slaves  主从关系里面的从服务器相关配置,smokeping里面从服务器只需要安装好就可以了,不需要配置,smokeping的所有配置都是在master上 面设置。这里主要设置好secrets密码文件和从服务器配置就可以了。下面我配置了两个从服务器。一个是st,一个是fy
  *** Slaves ***
  #secrets=/home/oetiker/checkouts/smokeping/trunk/software/etc/smokeping_secrets.dist
  secrets = /usr/local/etc/smokeping/slavesecrets.conf
  #+boomer
  #display_name=boomer
  #color=0000ff
  #location = HuaDong
  + st
  display_name = ShanTou Monitor
  color = 0000ff
  #location = HuanDong
  + fy
  display_name = FuYong
  color = 00ff00
  #++ override
  #Probes.FPing.binary = /usr/bin/fping
  第七部分 Targets 目标配置。在这里可以单独配置一台服务器的监控情况,需要从slave服务器上取值的配置也是在这里配置。我已经用注释说明的很清楚了。
  这里要注意一下。+代表一级菜单 +下面的++是继承上面的+成为二级菜单。 而且可以有多个一级菜单和二级菜单。
  *** Targets ***
  probe = FPing
  menu = Top
  title = Network Latency Grapher
  remark = Welcome to the SmokePing website of ShenZhen Wang Yu Company. \
          Here you will learn all about the latency of our network.
  ####### Slaves Configure ###########
  + Slaves
  menu = Slaves
  title = All of the Monitor From the Slaves
  ++ ShanTou
  menu = ShanTou
  title = Host 192.168.0.208 Monitor From Slaves
  slaves = st fy
  host = 192.168.0.208
  ++ FuYong
  menu = FuYong
  title = Host 192.168.0.210 Monitor From Slaves
  slaves = fy st
  host = 192.168.0.210
  ######## Single Hosts Monitor Configure ########
  + Hosts
  menu = Single
  #parents = owner:/Test/James location:/
  #title = Host in Test
  title = Single Host Monitor
  #++ James
  #menu = James
  #title =James
  #alerts = someloss
  #slaves = boomer slave2
  #host = 192.168.0.205
  ++ QQ
  menu = QQ
  title =
  www.qq.com
  host =
  www.qq.com
  ++ MFS-Monitor
  menu = MFS-Monitor
  title = Monitor
  host = 192.168.0.210
  ++ TaiWan
  menu = TaiWan-Server
  title = 229.84.216.221
  host = 229.84.216.221
  + Monitor
  menu = Monitor Servers
  title = Monitor Server Hosts
  ++ ShenZhen
  menu = ShenZhen
  title = SZ-Cacti
  host = 192.168.0.208
  ############# MultiHost Monitor In One Graph Configure #####
  + MultiHost
  menu = Multihost
  #title = James and James as seen from Boomer
  title = All Host In One Graph
  host = /Hosts/QQ /Hosts/MFS-Monitor /Hosts/TaiWan
  主/从 做分布式监控的时候有几点需要注意
  1.主从服务器上面的密码文件权限必须为600  而且主服务器上面的密码文件的属主必须为apache的启动用户
  2.从服务器上面的密码文件只需要一个密码就行,也就是主上面为它配置的那个密码。同样从服务器上面的密码文件的属主必须为smokeping的启动用户
  下面是主/从做分布式监控时我碰到的问题,及解决办法。写了一个简单的FQA
  Q:Slave启动的时候报错。
  [root@Nagios etc]# /usr/local/smokeping/bin/smokeping  --master-url=http://192.168.0.206/smokeping/smokeping.cgi  --cache-dir=/usr/local/smokeping/var/  --shared-secret=/usr/local/smokeping/etc/smokeping_secrets  --slave-name=ShenZhen
  WARNING: Opening secrets file /usr/local/etc/smokeping/slavesecrets.conf: Permission denied
  ERROR: we did not get config from the master. Maybe we are not configured as a slave for any of the targets on the master ?
  A:
  在master上面 对slavesecrets.conf文件 执行如下命令:
  chow smokeping slavesecrets.conf
  Q:
  [root@Nagios etc]# /usr/local/smokeping/bin/smokeping  --master-url=http://192.168.0.206/smokeping/smokeping.cgi  --cache-dir=/usr/local/smokeping/var/  --shared-secret=/usr/local/smokeping/etc/smokeping_secrets  --slave-name=ShenZhen
  WARNING: Data from ShenZhen was signed with 58e8b1b17440aa40fac67161b8c7a328 which does not match our expectation
  ERROR: we did not get config from the master. Maybe we are not configured as a slave for any of the targets on the master ?
  A:
  这个错误就是本地的密码文件配置错误,本地密码文件只保存master上面配置你这台slave的密码,只需要一个密码就可以了
  Q:
  [root@Nagios etc]# /usr/local/smokeping/bin/smokeping  --master-url=http://192.168.0.206/smokeping/smokeping.cgi  --cache-dir=/usr/local/smokeping/var/  --shared-secret=/usr/local/smokeping/etc/smokeping_secrets
  WARNING: No secret found for slave Nagios.kevinadmin.org
  ERROR: we did not get config from the master. Maybe we are not configured as a slave for any of the targets on the master ?
  A:
  在master上面的密码文件里加上Nagios.kevinadmin.org及对应的密码就可以了。
  Q:
  [root@Nagios etc]# /usr/local/smokeping/bin/smokeping  --master-url=http://192.168.0.206/smokeping/smokeping.cgi  --cache-dir=/usr/local/smokeping/var/  --shared-secret=/usr/local/smokeping/etc/smokeping_secrets
  WARNING: I don't know the slave Nagios.kevinadmin.org ignoring it
  ERROR: we did not get config from the master. Maybe we are not configured as a slave for any of the targets on the master ?
  A:
  这个是指在config文件里面没有定义Nagios.kevinadmin.org这个从服务器


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-664363-1-1.html 上篇帖子: 安装配置smokeping 下篇帖子: smokeping installation
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表