smokeping部署安装
smokeping部署安装
部署情况:
服务器IP:192.168.10.18
smokeping部署在/var/www/html/smokeping目录
smokeping部分命令:
smokeping --check
Smokeping --debug
smokeping --logfile=/var/log/smokeping.log
安装支持软件:
首先需要安装epel软件包,再进行yum
yum install gcc freetype-devel zlib-devel libpng-devel libart_lgpl-devel httpd-devel apr-util-devel apr-devel cairo cairo-devel pango pango-devel libxml2 libxml2-devel perl-XML-Simple.noarch perl-Crypt-SSLeay perl-Digest-HMAC
安装rrdtool
[root@smokeping smokeping]# tar -zxvf rrdtool-1.4.4.tar.gz -C /usr/local/
[root@smokeping smokeping]# cd /usr/local/rrdtool-1.4.4/
[root@smokeping rrdtool-1.4.4]# ./configure --prefix=/usr/local/rrdtool
[root@smokeping rrdtool-1.4.4]# make && make install
并将rrdtool路径加入环境变量
vi /etc/profile
export PKG_CONFIG_PATH=/usr/local/rrdtool/lib/pkgconfig
export PKG_CONFIG=/usr/local/rrdtool/bin/pkg-config
export PATH=/usr/local/rrdtool/bin:$PATH
安装Fping和Echoping,此处安装之后,配置环境变量即可,不需要严格按照路径安装
[root@smokeping bin]# cd /root/smokeping/
[root@smokeping smokeping]# tar -zxvf fping.tar.gz -C /usr/local/
[root@smokeping smokeping]# cd /usr/local/fping-2.4b2_to/
[root@smokeping fping-2.4b2_to]# ./configure
[root@smokeping fping-2.4b2_to]# make && make install
[root@smokeping fping-2.4b2_to]# ln -s /usr/local/fping/sbin/fping /usr/sbin/fping
[root@smokeping fping-2.4b2_to]#cd /root/smokeping/
[root@smokeping smokeping]#tar -zxvf echoping-6.0.2.tar.gz -C /usr/local/
[root@smokeping smokeping]#cd /usr/local/echoping-6.0.2
[root@smokeping echoping-6.0.2]# ./configure
[root@smokeping echoping-6.0.2]# make && make install
2.4 安装cgilib和SpeedyCGI
[root@smokeping echoping-6.0.2]# cd /root/smokeping/
[root@smokeping smokeping]# tar -zxvf cgilib-0.5.tar.gz -C /usr/local/
[root@smokeping smokeping]# cd /usr/local/cgilib-0.5/
[root@smokeping cgilib-0.5]# ls
cgi.5 cgiGetCookies.3 cgiRedirect.3 cookies.txt
cgi.c cgiGetValue.3 cgiSetHeader.3 CREDITS
cgiDebug.3 cgiGetVariables.3 cgiSetType.3 jumpto.c
cgiFree.3 cgi.h cgitest.c Makefile
cgiFreeList.3 cgiHeader.3 CHANGES readme
cgiGetCookie.3 cgiInit.3 cookies.c
[root@smokeping cgilib-0.5]#
[root@smokeping cgilib-0.5]# make
[root@smokeping cgilib-0.5]# cp libcgi.a /usr/local/lib
[root@smokeping cgilib-0.5]# cp cgi.h /usr/include/
[root@smokeping cgilib-0.5]# cd /root/smokeping/
[root@smokeping smokeping]# tar -zxvf CGI-SpeedyCGI-2.22.tar.gz -C /usr/local/
[root@smokeping smokeping]# cd /usr/local/CGI-SpeedyCGI-2.22/
[root@smokeping CGI-SpeedyCGI-2.22]# ls
COPYING Makefile.PL contrib mod_speedycgi speedy_backend util
Changes README docs mod_speedycgi2 speedy_dump
MANIFEST README.html lib speedy src
[root@smokeping CGI-SpeedyCGI-2.22]# perl Makefile.PL
[root@smokeping CGI-SpeedyCGI-2.22]# make
[root@smokeping CGI-SpeedyCGI-2.22]# make install
安装Perl模块
以下全是Smokeping 需要的perl 模块。
[root@smokeping ~]# yum install -y perl-libwww-perl perl-IO-Socket-SSL perl-Net-Telnet perl-Socket6 perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL
安装Smokeping
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.3.6.tar.gz
tar xzvf smokeping-2.3.6.tar.gz
cp -rp smokeping-2.3.6 /var/www/html/smokeping
三. Smokeping 初始化配置
3.1修改smokeping相关文件名
在smokeping的子目录中会发现很多“*.dist”命名的文件,这些文件使用的时候请将其改名为“*”并进行配置
cd /var/www/html/smokeping/bin/
cp smokeping.dist smokeping
cd ../htdocs/
cp smokeping.cgi.dist smokeping.cgi
cd ../etc/
cp basepage.html.dist basepage.html
cp config.dist config
cp smokemail.dist smokemail
chmod 600 smokeping_secrets.dist
3.2建立相关目录
接着建立三个目录用于保存smokeping的数据等,如下所示:
[root@smokeping ~]# mkdir
smokeping/data
[root@smokeping ~]# mkdir /var/www/html/smokeping/var
[root@smokeping ~]# mkdir /var/www/html/smokeping/cache
[root@smokeping ~]# yum install -y httpd
[root@smokeping ~]# chown -R apache.apache /var/www/html/smokeping
修改配置文件
形如:其中,标红部分需要根据实际路径和情况修改。
1./var/www/html/smokeping/etc/config文件
[root@cdn18 etc]# more config
*** General ***
owner = Peter Random
contact = some@address.nowhere
mailhost = my.mail.host
sendmail = /usr/lib/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 = /var/www/html/smokeping/htdocs/cache
#imgcache = /home/oetiker/public_html/smokeping-ms/cache
imgurl = http://192.168.10.18:8080/smokeping/cache
#imgurl = cache
datadir = /var/www/html/smokeping/data
#datadir = /tmp/smokeping-ms/data
piddir = /var/www/html/smokeping/var
#piddir = /tmp/smokeping-ms/var
cgiurl = http://192.168.10.18:8080/smokeping/smokeping.cgi
smokemail = /var/www/html/smokeping/etc/smokemail
#smokemail = /home/oetiker/checkouts/smokeping/trunk/software/etc/smokemail.dist
tmail = /var/www/html/smokeping/etc/tmail.dist
#tmail = /home/oetiker/checkouts/smokeping/trunk/software/etc/tmail.dist
# 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 ***
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
*** Database ***
step = 60
pings = 10
# 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 = /var/www/html/smokeping/etc/basepage.html
#template = /home/oetiker/checkouts/smokeping/trunk/software/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
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
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
*** Probes ***
+ FPing
binary = /usr/local/sbin/fping
sourceaddress = 0.0.0.0
*** Slaves ***
secrets=/var/www/html/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
location=dh
color=0000ff
+192.168.10.18
display_name=192.168.10.18
location=dh
color=0000ff
++override
Probes.FPing.binary = /usr/local/sbin/fping
Probes.FPing.sourceaddress = 192.168.10.18
+slave2
display_name=another
color=00ff00
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
Here you will learn all about the latency of our network.
+ Test
menu= Targets
#parents = owner:/Test/James location:/
++ James
menu = James
title =James
alerts = someloss
slaves = boomer slave2
host = 192.168.10.18
++ MultiHost
menu = Multihost
title = James and James as seen from Boomer
host = /Test/James /Test/James~boomer
+ DunHuang
menu = DunHuang
title = DunHuang
++ dhyk18
menu = dhyk18
title = dhyk18
host = 192.168.10.18
++ dhyk19
menu = dhyk19
title = dhyk19
host = 192.168.10.19
修改配置文件
/var/www/html/smokeping/htdocs/smokeping.cgi,标红部分请按照实际情况修改
#!/usr/bin/speedy -w
####!/usr/sepp/bin/speedy -w
# -*-perl-*-
#use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
use lib qw(/usr/local/rrdtool/lib/perl/);
use lib qw(/var/www/html/smokeping/lib);
#use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);
use CGI::Carp qw(fatalsToBrowser);
use Smokeping 2.003006;
Smokeping::cgi("/var/www/html/smokeping/etc/config");
#Smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config");
(4)配置apache /conf/httpd.conf
Alias /smokeping/ "/var/www/html/smokeping/htdocs/"
Alias /cache/ "/var/www/html/smokeping/cache/"
<Directory "/var/www/html/smokeping/htdocs">
Options FollowSymLinks ExecCGI
AllowOverride None
AddHandler cgi-script cgi
Order allow,deny
Allow from all
</Directory>
(2)检查smokeping配置文件:
[root@smokeping ~]# /usr/local/smokeping/bin/smokeping --check
Configuration file '/usr/local/smokeping/etc/config' syntax OK.
(3)启动smokeping:(无法启动)
[root@smokeping ~]# service smokeping start
ERROR: slave 'boomer' is not defined in the '*** Slaves ***' section!
/etc/init.d/smokeping start: smokeping could not be started
出现此类问题,是因为没有配置slave之类的,在前面的配置文件中,我已经配置,故不需要考虑。
实际解决方法如下:标红部分按照实际情况修改
[root@smokeping ~]# vim /var/www/html/smokeping/etc/config
+ FPing
binary = /usr/local/sbin/fping
sourceaddress = 0.0.0.0
*** Slaves ***
secrets=/var/www/html/smokeping/etc/smokeping_secrets.dist
+192.168.10.18
display_name=192.168.10.18
location=dh
color=0000ff
++override
Probes.FPing.binary = /usr/local/sbin/fping
Probes.FPing.sourceaddress = 192.168.10.18
[root@smokeping ~]# service smokeping restart
ERROR: /usr/local/smokeping/etc/config, line 111: File '/usr/local/smokeping/etc/smokeping_secrets.dist' is world-readable or writable, refusing it
/etc/init.d/smokeping start: smokeping could not be started
[root@smokeping src]# ll /usr/local/smokeping/etc/smokeping_secrets.dist
-rw-r--r-- 1 apache apache 59 Aug 21 2007 /usr/local/smokeping/etc/smokeping_secrets.dist
[root@smokeping src]# chmod 400 /usr/local/smokeping/etc/smokeping_secrets.dist
[root@smokeping src]# ll /usr/local/smokeping/etc/smokeping_secrets.dist
-r-------- 1 apache apache 59 Aug 21 2007 /usr/local/smokeping/etc/smokeping_secrets.dist
[root@smokeping ~]# ./smokeping restart
WARNING: Hostname 'james.address' does currently not resolve to an IPv6 or IPv4 address
ERROR: slave 'boomer' is not defined in the '*** Slaves ***' section!
/etc/init.d/smokeping start: smokeping could not be started
*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
location=dh
color=00ffff
+192.168.10.18
display_name=192.168.10.18
location=dh
color=0000ff
++override
Probes.FPing.binary = /usr/local/sbin/fping
Probes.FPing.sourceaddress = 192.168.10.18
+slave2
display_name=another
color=00ff00
[root@smokeping ~]# service smokeping restart
/etc/init.d/smokeping start: smokeping started
[root@smokeping ~]#
[root@smokeping ~]# service httpd restart
Stopping httpd: [ OK ]

smokeping部署安装的更多相关文章
- Android 开发环境在 Windows7 下的部署安装
Android SDK Android SDK 为 Android 应用的开发.测试和调试提了必要的API库和开发工具. ADT Bundle 下载 如果你是一个android 开发新手,推荐你下载使 ...
- Windows系统下部署安装一个/多个Tomcat8
首先从http://tomcat.apache.org/上下载Tomcat8.0压缩版的,解压到指定路径后即可. 第一:在Windows系统中安装部署单个Tomcat 对于这种情况, ...
- Zabbix监控windows部署安装
Zabbix agent 在windows上安装部署 1. 下载与解压 地址: http://www.zabbix.com/downloads/2.4.0/zabbix_agents_2.4.0.w ...
- Hadoop 2.2.0部署安装(笔记,单机安装)
SSH无密安装与配置 具体配置步骤: ◎ 在root根目录下创建.ssh目录 (必须root用户登录) cd /root & mkdir .ssh chmod 700 .ssh & c ...
- _00024 尼娜抹微笑伊拉克_云计算ClouderaManager以及CHD5.1.0群集部署安装文档V1.0
笔者博文:妳那伊抹微笑 itdog8 地址链接 : http://www.itdog8.com(个人链接) 博客地址:http://blog.csdn.net/u012185296 博文标题:_000 ...
- Ubuntu16.04 部署安装Docker容器 & 注意事项
一.部署安装Docker容器 1.1 Ubuntu下安装 crul sudo apt install curl curl是利用URL语法在命令行方式下工作的开源文件传输工具.它被广泛应用在Unix.多 ...
- Docker+Redis镜像的原理以及部署安装(超详解附截图)
文章来源:公众号-智能化IT系统. 一. DOCKER介绍 Docker简介 (1)Docker 是一个开源的应用容器引擎,基于 Go 语言,并遵从Apache2.0协议开源. (2)Docker 可 ...
- 单机多实例mysq 8.0l部署安装
单机多实例mysql部署安装 目的需求 在单台虚拟机部署部署多实例mysql,用于配置mysql replication,MHA等. 思路 多实例安装mysql可以参考<源编译MySQL8.0的 ...
- Hadoop教程(五)Hadoop分布式集群部署安装
Hadoop教程(五)Hadoop分布式集群部署安装 1 Hadoop分布式集群部署安装 在hadoop2.0中通常由两个NameNode组成,一个处于active状态,还有一个处于standby状态 ...
随机推荐
- 从头写一个Cucumber测试(一) Selenium Test
转载:https://yaowenjie.github.io/%E7%BC%96%E7%A8%8B%E7%9B%B8%E5%85%B3/cucumber-test, 背景(废话不读系列) 前段时间 ...
- 线程安全使用(四) [.NET] 简单接入微信公众号开发:实现自动回复 [C#]C#中字符串的操作 自行实现比dotcore/dotnet更方便更高性能的对象二进制序列化 自已动手做高性能消息队列 自行实现高性能MVC WebAPI 面试题随笔 字符串反转
线程安全使用(四) 这是时隔多年第四篇,主要是因为身在东软受内网限制,好多文章就只好发到东软内部网站,懒的发到外面,现在一点点把在东软写的文章给转移出来. 这里主要讲解下CancellationT ...
- [javase学习笔记]-8.7 静态代码块
这一节我们看一个比較特殊的概念,那就是静态代码块. 前面我们也提到过代码块,就是一段独立的代码空间.那么什么是静态代码块呢?说白了,就是用statickeyword修饰的代码块. 我们来看一个样例: ...
- C++ 中的几种初始化
前言 阅读C++教材时,想必你听过复制初始化,直接初始化,值初始化这三个概念吧.笔者本人常将其混淆,遂在此记录下它们的具体含义以便日后查阅. 复制初始化( copy-initialization ) ...
- Drawing Images and Text
using System;using UIKit;using Foundation;using CoreGraphics;namespace GraphicsAnimation{ public cla ...
- 【BZOJ2561】最小生成树 最小割
[BZOJ2561]最小生成树 Description 给定一个边带正权的连通无向图G=(V,E),其中N=|V|,M=|E|,N个点从1到N依次编号,给定三个正整数u,v,和L (u≠v),假设现在 ...
- live555中fDurationInMicroseconds的计算
live555中fDurationInMicroseconds表示单个视频或者音频帧所占用的时间间隔,也表示在fDurationInMicroseconds微秒时间后再次向Source进行getNex ...
- cocos2d-js实现 双击android后退按钮 即退出游戏
之前测了一下android自带的后退按钮,用在cocos2d-js中是没有获取到的 (可能是cocos2d-js已经把android的后退事件截取了,所以原生java代码没有用), 没办法就只能用co ...
- A桶中有多少水?
如果你能算出桶中有多少水,我便许你下山去玩.有一天,老和尚让小和尚将A桶的水挑到B桶去,可是小和尚却想下山玩,不愿意挑水,老和尚便说:”如果你能够根据我的提示算出A桶中有多少升水,我便许你下山去玩.” ...
- Nodejs通过Thrift操作hbase卡住原因分析及与javascript的垃圾回收机制的关系
在最近使用Nodejs通过Thrift操作hbase的时候写了个脚本,不断发送http请求,从而取得hbase下所需的数据,但是在run的过程中for循环并没有执行完全,在执行一部分后会卡住,就再也进 ...