Smokeping允许你监测多台服务器。 Smokeping使用RRDtool来存储数据,另外,其可基于RRDtool输出生成相应的统计图表。 Smokeping由两个部分组成。一个运行在后台、定期收集数据的服务。一个以图表形式展示数据的Web界面。

这个wiki页面包括安装smokeping后台服务和Web界面的基本步骤。

安装

这一节包括使用smokeping包安装Smokeping。 FastCGI的安装步骤可以参见Apache and FastCGI

smokeping软件包包括两个部分:

  • smokeping的后台服务和在/etc/smokeping/的配置文件。这个后台服务执行监测任务。
  • /srv/http/smokeping的“htdocs”。这些文件被Web界面所使用。

除了安装smokeping包之外,您还需要:

  • 一个smokeping监测的工具。fping 是默认ping探针的最简洁方法。
  • apache 和mod_fcgid 被用于Web界面。
  • 一个图像缓存目录,其可被FastCGI脚本写入,例如:/srv/smokeping/imgcache
  • 一个数据存储目录,其可被smokeping后台服务写入,同时可被FastCGI脚本读取,例如:/srv/smokeping/data
  • 确保主配置文件可被smokeping后台服务读取。

可选的安装

如果你想使用其他探针,例如DNS、http探针,你需要安装如下所示的其他软件包。 这些探针的配置并不包括在这个wiki页面中。

探针 所需软件包
Curl curl
DNS bind-tools (被用于Dig)
EchoPing echoping
SSH openssh
TelnetIOSPing perl-net-telnet
AnotherDNS perl-net-dns
LDAP perl-ldap
LDAP (tls) perl-io-socket-ssl
Authen perl-authen-radius

配置

Smokeping需要你编辑许多文件。 未编辑的文件的扩展名为.dist。将在/etc/smokeping目录中以.dist结尾的文件去除.dist后缀。 find 可以完成这件任务,同时打印出所有被重命名与需要编辑的文件。

# cd /etc/smokeping
# find . -name '*.dist' -print -execdir sh -c 'mv {} $(basename {} .dist)' \;
# mv /srv/http/smokeping/smokeping.fcgi.dist /srv/http/smokeping/smokeping.fcgi

编辑配置文件

下一步,编辑 /etc/smokeping/config 文件。这个文件是smokeping的主配置文件。 下面将用一个完整的配置文件例子简要介绍各节的功用。

/etc/smokeping/config 中 General 节是最容易被编辑的。 根据你个人信息个性化上述的配置文件。相应的条目均有注释。

注意:如果你没有安装sendmail的软件(例如:postfix 或 sendmail),使用一些别的东西代替,例如/bin/false。 你编辑的文件必须存在,否则smokeping将会报错。

Alerts 节。这个最小化的配置文件例子中并不需要 Alerts 节,所以你可以将其注释或删除。

Database 节不需要做任何改动。

Presentation 节中,模板文件的路径需要更新。

Probes 节规定哪些探针被激活。默认情况下,仅 FPing 探针被激活。这一节不需要做任何更改。

Slaves 节。这个最小化的配置文件例子中并不需要 Slaves 节,所以你可以将其注释或删除。注意:如果你在Slaves节中使用smokeping_secrets设置,你必须确保那个文件不能被其他用户访问,否则smokeping将会报错。chmod 600 /etc/smokeping/smokeping_secrets

Targets 节指定哪些主机将被探测(在这个例子中为ping的目标)。像如下的例子,根据你想要搜集统计数据的主机,个性化 Targets 节。

你可以在这个网址 http://oss.oetiker.ch/smokeping/doc/smokeping_examples.en.html 了解更多关于Smokeping 配置文件的知识。

/etc/smokeping/config
*** General ***

owner     = Your Name Here                            # 你的名字
contact = your.email@host.bla # 你的电子邮件地址
mailhost = your.smtp.server.bla # 你的邮件服务器
sendmail = /bin/false # sendmail程序路径
imgcache = /srv/smokeping/imgcache # filesystem directory where we store files
imgurl = imgcache # URL directory to find them
datadir = /srv/smokeping/data # daemon 与 webapp 共享的数据目录
piddir = /var/run # filesystem directory to store PID file
cgiurl = http://localhost/smokeping/smokeping.fcgi # 外部URL
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no *** Database *** step = 300
pings = 20 # 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 *** template = /etc/smokeping/basepage.html + 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 width = 600
height = 50
range = 10h + detail width = 600
height = 200
unison_tolerance = 2 "Last 3 Hours" 3h
"Last 30 Hours" 30h
"Last 10 Days" 10d
"Last 400 Days" 400d *** Probes *** + FPing binary = /usr/sbin/fping *** Targets *** probe = FPing menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of Arch User. \
Here you will learn all about the latency of our network. + targets
menu = Targets ++ ArchLinux menu = Arch Linux
title = Arch Linux Website
host = 66.211.214.131 ++ GoogleDNS menu = Google DNS
title = Google DNS server
host = 8.8.8.8 ++ MultiHost menu = Multihost example
title = Arch Wiki and Google DNS
host = /targets/ArchLinux /targets/GoogleDNS

有关smokeping配置文件语法的注意事项

每一个 + 号定义了一个有着层次等级的节。在节名称中不允许含有空格。英文句号 . 和正斜杠 / 同样应当尽量避免出现在节名称中。这是因为存储在数据目录下的RRD文件有着和节名称一样的文件名。

Targets 节,你可以用真实的主机名或其他节名称的路径来定义host,从而生成含有多个主机结果的图表,具体情况可以参考上面例子中的MultiHost

安装系统中的其他部分

创建配置文件提到的额外目录:

# mkdir -p /srv/smokeping/data
# mkdir -p /srv/smokeping/imgcache
# chown -R smokeping:smokeping /srv/smokeping
# chown -R http:http /srv/smokeping/imgcache
# chmod a+rx /srv/smokeping
# chmod -R a+rx /srv/smokeping/data

由于smokeping配置文件同时被smokeping服务和FastCGI脚本读取,所以它应当具有可读取权限:

# chmod a+rx /etc/smokeping
# chmod a+r /etc/smokeping/config

启动服务

启动 Start smokeping.service服务,并且确认它正在运行。

# systemctl start smokeping.service
# systemctl enable smokeping.service

安装Web界面

编辑/etc/httpd/conf/httpd.conf,使其包含以下内容:

/etc/httpd/conf/httpd.conf
 LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
AddHandler fcgid-script .fcgi
</IfModule> Alias /smokeping/imgcache /srv/smokeping/imgcache
Alias /smokeping /srv/http/smokeping <Directory "/srv/smokeping/imgcache">
AllowOverride all
Require all granted
</Directory> <Directory "/srv/http/smokeping">
Options FollowSymLinks ExecCGI
AllowOverride all
Require all granted
</Directory>

通过 httpd.service,启动 Start Apache 。

检查 http://localhost/smokeping/smokeping.fcgi 是否载入。第一批数据将在几分钟后出现。

如果由于字体原因导致图像不可读,你应当安装ttf-dejavu

高级配置

Smokeping是一个可以被多种方式配置的有力工具。你可以启动许多不同类型的探针。你可以设置发送统计信息的从属smokeping服务器(slave smokeping servers),并显示来自其他服务器的探测结果。 你也可以使用perl创建你自己的探针。这篇教程目前并没有讲解这些选项。如果你对这些内容感兴趣,可以查阅Smokeping官方网站上的资料。

Troubleshooting

The smokeping package is currently broken in several ways. To get the service to run as a daemon, you'll need to modify the provided systemd unit file to have this parameter:

   type=forking

Smokemail is also not currently included, and is a required file for smokeping to run. You'll need to download the file and add it manually from smokeping's github:

   https://github.com/oetiker/SmokePing/blob/master/etc/smokemail.dist

Smokeping的更多相关文章

  1. Smokeping -- 监控网络质量

    1.下载fping.echoping.smokeping 链接:http://pan.baidu.com/s/1pL4HLYb 密码:fxe2 2.安装依赖包 yum install -y perl ...

  2. Smokeping安装教程

    Smokeping安装教程 #Smokeping2.6.8安装教程 #2016.3.6 改编v1.0 #Linux运维技术交流 347163978   环境 CentOS release 6.4 (F ...

  3. Centos 6.7 安装smokeping (最完整教程)

    本教程需要的源码包一并上传了,届时可以直接上传到linux系统里面! 需要编译的fping.echoping.smokeping源码包,链接:http://pan.baidu.com/s/1pL4HL ...

  4. Linux下smokeping网络监控环境部署记录

    smokeping是一款监控网络状态和稳定性的开源软件(它是rrdtool的作者开发的),通过它可以监控到公司IDC的网络状况,如延时,丢包率,是否BGP多线等:smokeping会向目标设备和系统发 ...

  5. 一款监控网络状态的好工具- Smokeping

    最近工作中需要监测某个分公司到IDC机房的网络情况,到网络上找了不少软件,发现一款叫smokeping的开源软件还不错,它是rrdtool的作者制作的,在图形显示方面很漂亮,可以用来很好的检测网络状态 ...

  6. CentOS6.4安装Smokeping节点监控软件

    Smokeping:它是rrdtool的作者制作的,在图形显示方面很漂亮,可以用来很好的检测网络状态和稳定性,下面简单说一下Smokeping的安装以及配置方法. 0.首先关闭selinux和防火墙 ...

  7. Smokeping 监控部署及配置

    安装参见: https://github.com/oetiker/SmokePing/blob/master/doc/smokeping_install.pod 1 Smokeping *** Gen ...

  8. Smokeping如何清空图标数据

    先停smokeping服务 service smokeping stop 进去图表数据目录 /opt/smokeping/data /bin/rm -rf ./*   重新加载/opt/smokepi ...

  9. 运维监控利器smokeping 500报错处理

    检查apache日志发现有以下错误: No such file or directory: exec of '/usr/local/smokeping/htdocs/smokeping.cgi' fa ...

  10. smokeping报错Can't locate RRDs.pm in @INC (@INC contains

    安装完smokeping,执行debug语句: ./bin/smokeping --debug-daemon ,提示如下错误: Can't locate RRDs.pm in @INC (@INC c ...

随机推荐

  1. hadoop分布式安装部署详细视频教程(网盘附配好环境的CentOS虚拟机文件/hadoop配置文件)

    参考资源下载:http://pan.baidu.com/s/1ntwUij3视频安装教程:hadoop安装.flvVirtualBox虚拟机:hadoop.part1-part5.rarhadoop文 ...

  2. linux下64位汇编的系统调用(2)

    知道了syscall调用号之后还不算完,还要搞清楚2件事: 1 每种调用号需要传递哪些参数: 2 调用如何传递参数以及结果如何返回: 第一个问题的答案是: 在linux系统中某个程序执行时进行的系统调 ...

  3. 从Windows角度看Mac OS X上的软件开发

    如果原来从事Windows软件开发,想跨足或转换至Mac OS X环境,需要知道那些东西?有什么知识技能可以快速运用在Mac OS X环境上的?这两个问题应该是Windows开发者进入Mac OS X ...

  4. DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=2 (转载)

    http://blog.csdn.net/xiyuan1999/article/details/5706230 DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, ...

  5. Golang之Context的使用

    转载自:http://www.nljb.net/default/Golang%E4%B9%8BContext%E7%9A%84%E4%BD%BF%E7%94%A8/ 简介 在golang中的创建一个新 ...

  6. RxJava 2.x 使用最佳实践

    转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/76443347 本文出自[赵彦军的博客] 以前写过 Rxjava 系列教程, 如下所 ...

  7. Centos7下安装MySql

    1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start maria ...

  8. 第一课:Hadoop集群环境搭建

    一. 检查列表 1.1.网络访问 设置电脑IP以及可以访问网络设置:进入etc/sysconfig/network-scripts/,使用命令"ls -all" 查看文件.会看到i ...

  9. CentOS-Minimal版本下安装telnet服务和xinetd服务

    默认在CentOS-Minimal版本下没有安装telnet和xinetd服务. 1.安装telnet [root@localhost ~]# rpm -qa | grep telnet  --检查是 ...

  10. Java多线程:wait(),notify(),notifyAll()

    1. wait(),notify(),notifyAll() 2. wait() 2.1. wait() 2.2. wait(long timeout) 2.3. wait(long timeout, ...