ping的配置文件 linux,SmokePing之配置文件config详解
这个配置文件不管在Linux下面还是在BSD下面是一致的。
如下解说:
整个config文件里面只有#是注释
第一部分 General 属于基本配置。值得注意的地方有imgcache和imgurl这两个参数,要注意一下,和apache配置相关联,如果配置不好的话,打开web的时候图片会显示不出来。
*** General ***
owner = Kevin Deng
contact = kevinadmin@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 p_w_picpaths.
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 是属于报警配置, 这个我还没有测试过。以后再说
+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 = <10,<10,<10,<10,<10,<100,>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
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.201
host = 229.84.216.201
+ 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这个从服务器
ping的配置文件 linux,SmokePing之配置文件config详解相关推荐
- linux中httpd配置文件,linux httpd.conf文件配置详解
Apache的基本设置主要交由httpd.conf来设定管理,我们要修改Apache的相关设定,主要还是通过修改httpd.conf来实现.下面让我们来看看httpd.conf的内容,它主要分成3大部 ...
- SpringBoot配置文件中spring.profiles.active配置详解
SpringBoot配置文件中spring.profiles.active配置详解 1.多环境配置 我们在开发Spring Boot应用时,通常同一套程序会被应用和安装到几个不同的环境,比如:开发.测 ...
- linux下rsync命令,Linux 命令之rsync命令详解
rsync命令 rsync命令是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件.rsync使用所谓的"rsync算法"来使本地和远程两个主机之间的文件达到同步, ...
- Linux rpm 命令参数使用详解
Linux rpm 命令参数使用详解 RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的"添加/删除程序" rpm 执行安装 ...
- App.Config详解
App.Config详解 应用程序配置文件是标准的 XML 文件,XML 标记和属性是区分大小写的.它是可以按需要更改的,开发人员可以使用配置文件来更改设置,而不必重编译应用程序. 配置文件的根节点是 ...
- Linux账号和权限管理详解(超详细示例操作)!
Linux账号和权限管理详解 一.用户账号和组账号概述 1.1 Linux基于用户身份对资源访问进行控制 1.2 用户账号 1.3 组账号 二.用户账号文件 2.1 用户账号文件 /etc/passw ...
- linux输入一个用户看是否在工作,linux下的用户管理详解
linux下的用户管理详解 useradd 命令详解 添加用户 想要对linux下面的帐号了解的话首先必须要了解的4个配置文件[root@localhost /]# cat /etc/passwd 首 ...
- Linux驱动开发必看详解神秘内核(完全转载)
Linux驱动开发必看详解神秘内核 完全转载-链接:http://blog.chinaunix.net/uid-21356596-id-1827434.html IT168 技术文档]在开始步入Lin ...
- mysql5.7.11 linux_CentOS 7 中以命令行方式安装 MySQL 5.7.11 for Linux Generic 二进制版本教程详解...
MySQL 目前的最新版本是 5.7.11,在 Linux 下提供特定发行版安装包(如 .rpm)以及二进制通用版安装包(.tar.gz).一般情况下,很多项目都倾向于采用二进制通用安装包形式来进行安 ...
最新文章
- win10 nms cpu编译-ok
- 【David Silver强化学习公开课】-3:DP
- jQuery解决高度统一问题
- 移植MT76x8 私有WIFI驱动V4.1.0.0到Openwrt 18.06所遇到的坑
- 零售连锁管理软件_连锁超市用哪个收银软件好?
- Moss/Sharepoint:自定义 Oracle Membership
- IDEA : IDEA好用的插件集锦
- requestAnimationFrame 优化Web动画
- Facebook的体系结构分析---外文转载
- python3-基础8
- 【车道线检测与寻迹】2月17日 车道线检测carry边缘检测+Hough哈夫变换法
- 戴尔服务器调节风扇转速
- CMAKE Opencv配置
- java毕业设计——基于java+Java Swing+sqlserver的图书馆书库管理系统设计与实现(毕业论文+程序源码)——图书馆书库管理系统
- win10WIFI图标消失,只显示一个带红叉的窗口(或者飞行模式的符号)
- 关于癌症的思考:癌症的本质是什么
- three.js中坐标系转换以及camera的position、lookAt与up属性理解
- 【熬夜猛肝万字博文】学妹问我怎么入门 Javascript,百般盘问下我终于决定贡献出自己的 JavaScript入门笔记(三)
- Android向SDCard中上传文件时报错:Failed to push items
- 2021年中国兔养殖行业现状及前景分析[图]