安装和使用Smokeping

(一)简介
smokeping是对IDC网络质量,稳定性等最好的检测工具,包括常规的 ping,dig,echoping,curl等,可以监视www服务器性能,监视dns查询性能,监视ssh性能等。底层也是 rrdtool 做支持,特点是画的图非常漂亮,网络丢包和延迟用颜色和阴影来表示。

smokeping的优点:
最佳的画图功能,延迟和丢包用颜色和阴影表示很直观。
免费和开源,作者是MRTG和RRDtool作者。
支持主从的分布式模式。
可以自定义报警功能。

smokeping架构组件:
smokeping 是一个用 perl 写的程序,所以不需要安装,但是他需要使用一些工具。Smokeping 有以下组件组成:RRDtool、Fping、Echoping、Curl、Dig、SSh、Perl 模块,Perl、FCGI、Apache 等。

Smokeping环境:
CentOS7.4 +Smokeping2.6.11

(二)安装
1,关闭selinux

[[email protected] tmp]# setenforce 0
[[email protected] tmp]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
[[email protected] tmp]# source  /etc/selinux/config 

2,安装相关依赖的包
[[email protected] tmp]# yum install -y rrdtool wqy* fping gcc echoping curl bind-utils httpd httpd-devel perl perl-FCGI perl-CGI perl-CGI-SpeedyCGI perl-CGI-SpeedyCGI perl-libwww-perl perl-Socket6 perl-Net-Telnet perl-Net-OpenSSH perl-Net-DNS perl-LDAP perl-IO-Socket-SSL perl-ExtUtils-MakeMaker rrdtool-perl perl-Sys-Syslog perl-RadiusPerl perl-Time-HiRes perl-RRD-Simple libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel mod_fastcgi

3,官网下载相应的安装包(https://oss.oetiker.ch/smokeping/

[[email protected] tmp]# wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
--2018-01-18 18:28:30--  https://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
Resolving oss.oetiker.ch (oss.oetiker.ch)... 46.140.183.210, 2a02:aa08:e000:1e00::d2
Connecting to oss.oetiker.ch (oss.oetiker.ch)|46.140.183.210|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 417338 (408K) [application/x-gzip]
Saving to: ‘smokeping-2.6.11.tar.gz’

100%[=======================================================================================>] 417,338     63.2KB/s   in 6.5s   

2018-01-18 18:28:39 (63.2 KB/s) - ‘smokeping-2.6.11.tar.gz’ saved [417338/417338]

4,编译安装smokeping

#请注意在configure前需要先build相应的perl模块,否则有报错。
[[email protected] tmp]# ls
ks-script-HudzSv  smokeping-2.6.11.tar.gz  yum.log
[[email protected] tmp]# tar xf smokeping-2.6.11.tar.gz
[[email protected] tmp]# cd smokeping-2.6.11
[[email protected] smokeping-2.6.11]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
[[email protected] smokeping-2.6.11]# ./configure --prefix=/usr/local/smokeping
[[email protected] smokeping-2.6.11]# gmake install

5,配置smokeping
1,创建相应的目录并赋予权限

[[email protected] smokeping-2.6.11]# cd /usr/local/smokeping/
[[email protected] smokeping]# ll
total 0
drwxr-xr-x. 2 root root  75 Jan 18 19:35 bin
drwxr-xr-x. 3 root root 137 Jan 18 19:35 etc
drwxr-xr-x. 3 root root  48 Jan 18 19:35 htdocs
drwxr-xr-x. 3 root root 100 Jan 18 19:35 lib
drwxr-xr-x. 3 root root  17 Jan 18 19:35 share
drwxr-xr-x. 6 root root  67 Jan 18 19:34 thirdparty
[[email protected] smokeping]# mkdir var cache data
[[email protected] smokeping]# chown apache.apache var/ cache/ data/
[[email protected] smokeping]# ll
total 0
drwxr-xr-x. 2 root   root    75 Jan 18 19:35 bin
drwxr-xr-x. 2 apache apache   6 Jan 18 19:48 cache
drwxr-xr-x. 2 apache apache   6 Jan 18 19:48 data
drwxr-xr-x. 3 root   root   137 Jan 18 19:35 etc
drwxr-xr-x. 3 root   root    48 Jan 18 19:35 htdocs
drwxr-xr-x. 3 root   root   100 Jan 18 19:35 lib
drwxr-xr-x. 3 root   root    17 Jan 18 19:35 share
drwxr-xr-x. 6 root   root    67 Jan 18 19:34 thirdparty
drwxr-xr-x. 2 apache apache   6 Jan 18 19:48 var

2,备份fcgi文件与config文件

[[email protected] smokeping]# cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist  /usr/local/smokeping/htdocs/smokeping.fcgi
[[email protected] smokeping]# cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config

3,修改config文件,把cgiurl = http://some.url/smokeping.cgi中的some.url换成你的IP地址

[[email protected] smokeping]# sed -i ‘s|some.url|172.20.66.111|g‘ /usr/local/smokeping/etc/config
[[email protected] smokeping]# vim etc/config

*** General ***

owner    = Peter Random
contact  = [email protected]
mailhost = my.mail.host
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/cache
imgurl   = cache
datadir  = /usr/local/smokeping/data
piddir  = /usr/local/smokeping/var
cgiurl   = http://172.20.66.111/smokeping.cgi

4,Alerts和database配置

*** Alerts ***
to = [email protected]
from = [email protected]

+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row

#新增rtt监测机制
+rttdetect
type = rtt
# in milliseconds
pattern = <55,<55,<55,>55,>55,>55
comment = 每次发出60个包,连续3次轮询检查延时超过55毫秒

*** Database ***
######默认300秒ping20次,修改为120秒ping30次
step     = 120
pings    = 30

5,presentation配置,添加utf-8字符集和在detail部分,修改历史数据展示的时间

*** Presentation ***
###添加UTF-8中文字符集
charset = utf-8

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

+ 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

width = 600
height = 50
range = 10h

+ detail

width = 600
height = 200
unison_tolerance = 2

"Last 10 Minutes" 10m
"Last 30 Minutes" 30m
"Last 4 Hours" 4h
"Last 12 Hours" 12h
"Last 1 Days" 24h
"Last 3 Days" 3d
"Last 1 Weeks" 7d
"Last 1 Mouths" 30d
"Last Half years" 180d
"Last 1 years" 365d
#"Last 3 Hours"    3h
#"Last 30 Hours"   30h
#"Last 10 Days"    10d
#"Last 400 Days"   400d

6,修改账号文件权限
[[email protected] smokeping]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
7,创建登录账号和密码

[[email protected] smokeping]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin
New password:
Re-type new password:
Adding password for user admin
[[email protected] smokeping]# 

7,设置httpd的访问路径

[[email protected] smokeping]# vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"

Alias /cache "/usr/local/smokeping/cache/"
Alias /cropper "/usr/local/smokeping/htdocs/cropper/"
Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"

<Directory "/usr/local/smokeping">
    AllowOverride None
    Options All
    AddHandler cgi-script .fcgi .cgi
    Order allow,deny
    Allow from all
    AuthName "Smokeping"
    AuthType Basic
    AuthUserFile /usr/local/smokeping/htdocs/htpasswd
    Require valid-user
    DirectoryIndex smokeping.fcgi
</Directory> 

8,关闭防火墙

[[email protected] smokeping]# service firewalld stop
[[email protected] smokeping]# systemctl stop iptables.service

9.设置开机启动
[[email protected] smokeping]# echo "/usr/local/smokeping/bin/smokeping &"&gt;&gt; /etc/rc.local

原文地址:http://blog.51cto.com/liqingbiao/2062604

时间: 2024-11-08 16:23:11

安装和使用Smokeping的相关文章

安装和使用Smokeping(二)

(一)图表参数说明 (1).RTT(Round-Trip Time)简单说它是一个数据报在网络上两点中间往返一次的时间.是影响TCP性能和表征网络运行状况的重要参数.在网络中实时.准确地测量大量TCP设备和系统的RTT参数是网络管的重要环节之一.Smokeping就是这样的自动测试系统,它向目标设备和系统发送各种类型的测试数据包,测量.记录和展示RTT. (2).Median RTT 中间数它是中间数并不是平均值.Smokeping有多种类型的探针,探针在默认的设置下,每300秒向目标设备发送2

网络检测工具smokeping安装配置

smokeping是MRTG和RRDtool作者Tobi Oetiker的作品,主要用于对IDC网络质量,稳定性等做检测,主要功能包括常规的ping,dig,echoping,curl等,依赖rrdtool来画图.选择smokeping我觉得有以下原因: 1,最佳的画图功能,延迟和丢包用颜色和阴影表示很直观. 2,免费和开源. 3,支持主从的分布式模式. 4,可以自定义报警功能. smokeping官方网站:http://oss.oetiker.ch/smokeping/ 如下安装配置的系统为:

Smokeping网络监控

下载:http://oss.oetiker.ch/smokeping/pub/ 部署参考:http://www.cnblogs.com/ahwwmb/archive/2013/03/12/2955678.html 部署参考http://www.mamicode.com/info-detail-1396960.html 第1章 基本概念 Smokeping 主要是监视网络性能,包括常规的 ping,用 echoping 监视 www 服务器性能,监视 dns 查询性能,监视 ssh 性能等.底层也

smokeping 监控

# 公司新拉了一个线路,需要测试网络质量以及丢包率,找了许久才找着有smokeping这款软件 以下主要功能 _用于监控公司网络质量,地址都使用的是各地的教育网地址,还有各地机房连接 el7也有一键安装,源码包比较费劲:一部分依赖包,拉至最下面有安装 下载:http://pan.baidu.com/s/1hrJiLBA 安装可以使用yum包一键安装  系统el6 下载地址: http://mirror.ghettoforge.org/distributions/gf/el/6/gf/x86_64

Smokeping安装

系统centos6.X 1.配置固定IP地址 2.关闭iptables 3.关闭selinux 4.安装其他yum源 rpm -Uvh http://ftp.pbone.net/mirror/apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 5.安装依赖包 yum -y install perl perl-Net-Telnet perl-Net-DNS perl-LDAP

Centos安装smokeping教程

Centos安装smokeping教程 一 .安装基本依赖包 ntpdate time.windows.com #64bit rpm -Uhv http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm #32bit #rpm -Uhv http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release

全网首发!! centos7.2 安装smokeping

第1章 基本概念 第2章 安装 2.0 时间同步 yum -y install ntpdate ntpdate times.aliyun.com 2.1 安装依赖包 yum groupinstall "Compatibility libraries" "Base" "Development tools" -y   yum -y installcpan perl perl-FCGI perl-CGI perl-Digest-HMAC perl-Ne

最基础的 ubuntu smokeping安装

ubuntu 14.04 安装 smokeping 安装smokeping及其依赖包$ sudo apt-get install smokeping curl libauthen-radius-perl libnet-ldap-perl libnet-dns-perl libio-socket-ssl-perl libnet-telnet-perl libsocket6-perl libio-socket-inet6-perl apache2 配置apache cd /etc/apache2/c

CentOS6 smokeping安装配置

smokeping安装部署文档: 下载smokeping http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz 安装第三方源 rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 安装依赖包 yum -y install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl