SmokePing安装手册
SmokePing安装部署
SmokePing简介
Smokeping是一款用于网络性能监测的开源监控软件,主要用于对IDC的网络状况,网络质量,稳定性等做检测,通过rrdtool制图方式,图形化地展示网络的时延情况,进而能够清楚的判断出网络的即时通信情况。
SmokePing的特点
SmokePing keeps track of your network latency:
- Best of breed latency visualisation.(最佳图形展示功能,延时丢包等可以很直观的可视化展现)
- Interactive graph explorer.(交互式浏览器图表)
- Wide range of latency measurement plugins.(丰富的网络状况测量插件)
- Master/Slave System for distributed measurement.(支持主从的分布式部署模式)
- Highly configurable alerting system.(自定义报警功能)
- Live Latency Charts with the most 'interesting' graphs.(漂亮、免费、开源)
- Free and OpenSource Software written in Perl written by Tobi Oetiker, the creator of MRTG and RRDtool
SmokePing安装
[root@linux-node1 ~]# cat /etc/redhat-release #查看系统环境
CentOS Linux release 7.2.1511 (Core)
[root@linux-node1 ~]# uname -r
3.10.0-327.18.2.el7.x86_64
[root@linux-node1 ~]# yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP
perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-CGI-SpeedyCGI perl-FCGI perl-ExtUtils-MakeMaker
rrdtool rrdtool-perl curl fping echoping httpd httpd-devel gcc make wget libxml2-devel
libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel
libart_lgpl libart_lgpl-devel freetype freetype-devel #安装所需包
[root@linux-node1 ~]# cd /usr/local/src
[root@linux-node1 src]# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz #下载smokeping
[root@linux-node1 src]# tar xf smokeping-2.6.11.tar.gz #解压
[root@linux-node1 src]# cd smokeping-2.6.11
[root@linux-node1 smokeping-2.6.11]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty #远程下东东,需要点时间,需要build都ok,不然编译会报错
[root@linux-node1 smokeping-2.6.11]# ./configure --prefix=/usr/local/smokeping #编译
Ready to install Smokeping ******************************
Settings:
PERL5LIB = not set
PERL = /usr/bin/perl
The Smokeping Makefiles use GNU make functionality.
Continue installation with
/usr/bin/gmake install
#出现这个提示就可以用gmake安装了
[root@linux-node1 smokeping-2.6.11]# /usr/bin/gmake install #安装
#出现错误 Can't locate Sys/Syslog.pm in @INC (@INC contains: /usr/local/smokeing/thirdparty/lib/perl5/x86_64-linux-thread-multi /usr/local/smokeing/thirdparty/lib/perl5 ../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ../lib/Smokeping.pm line 16.
[root@linux-node1 smokeping-2.6.11]# yum -y install perl-Sys-Syslog #缺包了,安装这个就OK
[root@linux-node1 smokeping-2.6.11]# cd /usr/local/smokeping/ #进入smokeping安装目录
[root@linux-node1 smokeping-2.6.11]# mkdir cache data var #创建所需文件夹
[root@linux-node1 smokeping-2.6.11]# touch /var/log/smokeping.log #创建日志文件
[root@linux-node1 smokeping-2.6.11]# chown apache.apache cache data var /var/log/smokeping.log #修改文件属主
[root@linux-node1 smokeping]# cd htdocs
[root@linux-node1 htdocs]# mv smokeping.fcgi.dist smokeping.fcgi #修改文件名
[root@linux-node1 htdocs]# mv /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config #添加配置文件
[root@linux-node1 htdocs]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist #密码配置文件只让root能访问
修改smokeping配置文件
[root@linux-node1 ~]# sed -i 's#cgiurl = http://some.url/smokeping.cgi#cgiurl = http://192.168.182.152/smokeping.cgi#g' /usr/local/smokeping/etc/config
[root@linux-node1 ~]# sed -i 's#300#60#g' /usr/local/smokeping/etc/config #改为60,一分钟采集一次数据
[root@linux-node1 ~]# sed -i 's#20#60#g' /usr/local/smokeping/etc/config #改为一分钟ping60次
[root@linux-node2 ~]# vim /usr/local/smokeping/etc/config #添加utf-8中文字符集支持
*** Presentation ***
charset = utf-8
[root@linux-node1 ~]# egrep "cgiurl|\<60\>|utf-8" /usr/local/smokeping/etc/config #查看修改的配置
cgiurl = http://192.168.56.11/smokeping.cgi
step = 60 #一分钟采集一次数据
pings = 60
charset = utf-8
修改apache配置文件
[root@linux-node1 htdocs]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd luchuangao
New password:
Re-type new password:
Adding password for user luchuangao #设置登陆密码
[root@linux-node1 htdocs]# 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>
创建Smokeping启动脚本
[root@linux-node1 etc]# cat /etc/init.d/smokeping
#!/bin/bash
#
# chkconfig: 2345 80 05
# Description: Smokeping init.d script
# Hacked by : How2CentOS - http://www.how2centos.com
# Get function from functions library
. /etc/init.d/functions
# Start the service Smokeping
start() {
echo -n "Starting Smokeping: "
/usr/local/smokeping/bin/smokeping >/dev/null 2>&1
### Create the lock file ###
touch /var/lock/subsys/smokeping
success $"Smokeping startup"
echo
}
# Restart the service Smokeping
stop() {
echo -n "Stopping Smokeping: "
kill -9 `ps ax | grep "/usr/local/smokeping/bin/smokeping" | grep -v grep | awk '{ print $1 }'` >/dev/null 2>&1
### Now, delete the lock file ###
rm -f /var/lock/subsys/smokeping
success $"Smokeping shutdown"
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status smokeping
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
[root@linux-node1 etc]# chmod 755 /etc/init.d/smokeping
启动服务访问smokeping
[root@linux-node1 ~]# systemctl start httpd.service #启动apache
[root@linux-node1 ~]# /etc/init.d/smokeping start #启动smokeping
在浏览器输入http://192.168.5182.152/smokeping,输入之前设定的密码:
效果展示,略!
中文支持及添加监控节点
如果需要展示界面支持中文,需要安装中文编码:
[root@linux-node1 etc]# yum -y install wqy-zenhei-fonts.noarch
[root@linux-node1 etc]# vi /usr/local/smokeping/lib/Smokeping/Graphs.pm
for my $host (@hosts){
my ($graphret,$xs,$ys) = RRDs::graph
("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],
'--font TITLE:20:"WenQuanYi Zen Hei Mono"', #添加这行即可
vim /usr/local/smokeping/etc/config
#添加监测源的IP库,加入到config中,修改后重启smokeping才会生效
#添加监控节点示例:注意+是第一层,++是第二层,+++ 是第三层
+ Unicom
menu = 各地网络连通性监控
title = 监控统计
++ Telecom
menu = 电信网络监控
title = 电信网络监控列表
host = /Unicom/Telecom/telecom-beijing /Unicom/Telecom/telecom-shanghai /Unicom/Telecom/telecom-shenyang /Unicom/Telecom/telecom-sichuan /Unicom/Telecom/telecom-changsha /Unicom/Telecom/telecom-jiangsu /Unicom/Telecom/telecom-chongqing /Unicom/Telecom/telecom-fujian /Unicom/Telecom/telecom-guizhou /Unicom/Telecom/telecom-hubei /Unicom/Telecom/telecom-chengdu /Unicom/Telecom/telecom-xinjiang /Unicom/Telecom/telecom-wuhan /Unicom/Telecom/telecom-hangzhou /Unicom/Telecom/telecom-xiamen /Unicom/Telecom/telecom-guangzhou /Unicom/Telecom/telecom-shenzhen /Unicom/Telecom/telecom-nanning /Unicom/Telecom/telecom-beijingxinlang /Unicom/Telecom/telecom-beijingDNS /Unicom/Telecom/telecom-shanghaixinlang /Unicom/Telecom/telecom-shanghaiDNS
+++ telecom-beijing
menu = 北京电信
title = 北京电信
alerts = someloss
host = 220.181.22.1
+++ telecom-beijingxinlang
menu = 北京新浪电信
title = 北京新浪电信
alerts = someloss
host = 218.30.114.37
+++ telecom-beijingDNS
menu = 北京电信DNS
title = 北京电信DNS
alerts = someloss
host = 219.141.136.10
+++ telecom-shanghaixinlang
menu = 上海新浪电信
title = 上海新浪电信
alerts = someloss
host = 222.73.28.96
+++ telecom-shanghaiDNS
menu = 上海电信DNS
title = 上海电信DNS
alerts = someloss
host = 202.96.199.133
+++ telecom-shanghai
menu = 上海电信
title = 上海电信
alerts = someloss
host = 61.129.65.58
+++ telecom-shenyang
menu = 沈阳电信
title = 沈阳电信
alerts = someloss
host = 219.148.204.66
+++ telecom-sichuan
menu = 四川电信
title = 四川电信
alerts = someloss
host = 211.149.224.160
+++ telecom-changsha
menu = 长沙电信
title = 长沙电信
alerts = someloss
host = 124.232.150.171
+++ telecom-jiangsu
menu = 江苏电信
title = 江苏电信
alerts = someloss
host = 58.215.186.208
+++ telecom-chongqing
menu = 重庆电信
title = 重庆电信
alerts = someloss
host = 219.153.71.238
+++ telecom-fujian
menu = 福建电信
title = 福建电信
alerts = someloss
host = 218.6.9.4
+++ telecom-guizhou
menu = 贵州电信
title = 贵州电信
alerts = someloss
host = 222.87.128.7
+++ telecom-hubei
menu = 十堰电信
title = 十堰电信
alerts = someloss
host = 61.183.41.197
+++ telecom-chengdu
menu = 成都电信
title = 成都电信
alerts = someloss
host = 61.139.2.69
+++ telecom-xinjiang
menu = 新疆电信
title = 新疆电信
alerts = someloss
host = 61.128.114.133
+++ telecom-wuhan
menu = 武汉电信
title = 武汉电信
alerts = someloss
host = 221.232.129.35
+++ telecom-hangzhou
menu = 杭州电信
title = 杭州电信
alerts = someloss
host = 202.96.96.68
+++ telecom-xiamen
menu = 厦门电信
title = 厦门电信
alerts = someloss
host = 202.101.103.54
+++ telecom-guangzhou
menu = 广州电信
title = 广州电信
alerts = someloss
host = 211.136.192.6
+++ telecom-shenzhen
menu = 深圳电信
title = 深圳电信
alerts = someloss
host = 202.96.154.15
+++ telecom-nanning
menu = 南宁电信
title = 南宁电信
alerts = someloss
host = 202.103.224.68
++ Mobile
menu = 移动网络监控
title = 移动网络监控列表
host = /Unicom/Mobile/mobile-beijing /Unicom/Mobile/mobile-shenyang /Unicom/Mobile/mobile-jinan /Unicom/Mobile/mobile-qingdao /Unicom/Mobile/mobile-chengdu /Unicom/Mobile/mobile-xizang /Unicom/Mobile/mobile-xiamen /Unicom/Mobile/mobile-changsha /Unicom/Mobile/mobile-nanjing /Unicom/Mobile/mobile-guangzhou /Unicom/Mobile/mobile-shenzhen
+++ mobile-beijing
menu = 北京移动
title = 北京移动
alerts = someloss
host = 211.136.17.107
+++ mobile-shenyang
menu = 沈阳移动
title = 沈阳移动
alerts = someloss
host = 211.137.32.178
+++ mobile-jinan
menu = 济南移动
title = 济南移动
alerts = someloss
host = 211.137.191.26
+++ mobile-qingdao
menu = 青岛移动
title = 青岛移动
alerts = someloss
host = 202.102.128.68
+++ mobile-chengdu
menu = 成都移动
title = 成都移动
alerts = someloss
host = 202.98.96.68
+++ mobile-xizang
menu = 西藏移动
title = 西藏移动
alerts = someloss
host = 211.139.73.34
+++ mobile-xiamen
menu = 厦门移动
title = 厦门移动
alerts = someloss
host = 218.207.194.109
+++ mobile-changsha
menu = 长沙移动
title = 长沙移动
alerts = someloss
host = 211.142.236.87
+++ mobile-nanjing
menu = 南京移动
title = 南京移动
alerts = someloss
host = 221.131.143.68
+++ mobile-guangzhou
menu = 广州移动
title = 广州移动
alerts = someloss
host = 211.136.192.6
+++ mobile-shenzhen
menu = 深圳移动
title = 深圳移动
alerts = someloss
host = 120.196.165.7
++ Unicom
menu = 联通网络监控
title = 联通网络监控列表
host = /Unicom/Unicom/unicom-beijing /Unicom/Unicom/unicom-dalian /Unicom/Unicom/unicom-henan /Unicom/Unicom/unicom-heilongjiang /Unicom/Unicom/unicom-tianjin /Unicom/Unicom/unicom-shanghai /Unicom/Unicom/unicom-shenyang /Unicom/Unicom/unicom-xian /Unicom/Unicom/unicom-jinan /Unicom/Unicom/unicom-qingdao /Unicom/Unicom/unicom-xinjiang /Unicom/Unicom/unicom-xizang /Unicom/Unicom/unicom-wuhan /Unicom/Unicom/unicom-zhengzhou /Unicom/Unicom/unicom-changsha /Unicom/Unicom/unicom-nanjing /Unicom/Unicom/unicom-xiamen /Unicom/Unicom/unicom-taiyuan /Unicom/Unicom/unicom-guangzhou /Unicom/Unicom/unicom-shenzhen /Unicom/Unicom/unicom-nanning
+++ unicom-beijing
menu = 北京联通
title = 北京联通
alerts = someloss
host = 123.125.46.202
+++ unicom-dalian
menu = 大连联通
title = 大连联通
alerts = someloss
host = 218.61.8.10
+++ unicom-henan
menu = 河南联通
title = 河南联通
alerts = someloss
host = 125.46.54.236
+++ unicom-heilongjiang
menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 125.211.202.138
+++ unicom-tianjin
menu = 天津联通
title = 天津联通
alerts = someloss
host = 60.28.24.236
+++ unicom-shanghai
menu = 上海联通
title = 上海联通
alerts = someloss
host = 211.95.72.254
+++ unicom-shenyang
menu = 沈阳联通
title = 沈阳联通
alerts = someloss
host = 113.224.187.254
+++ unicom-xian
menu = 西安联通
title = 西安联通
alerts = someloss
host = 124.89.76.214
+++ unicom-jinan
menu = 济南联通
title = 济南联通
alerts = someloss
host = 202.102.152.3
+++ unicom-qingdao
menu = 青岛联通
title = 青岛联通
alerts = someloss
host = 202.102.128.68
+++ unicom-xinjiang
menu = 新疆联通
title = 新疆联通
alerts = someloss
host = 221.7.1.20
+++ unicom-xizang
menu = 西藏联通
title = 西藏联通
alerts = someloss
host = 221.13.65.38
+++ unicom-wuhan
menu = 武汉联通
title = 武汉联通
alerts = someloss
host = 218.104.111.122
+++ unicom-zhengzhou
menu = 郑州联通
title = 郑州联通
alerts = someloss
host = 218.28.199.235
+++ unicom-changsha
menu = 长沙联通
title = 长沙联通
alerts = someloss
host = 58.20.127.238
+++ unicom-nanjing
menu = 南京联通
title = 南京联通
alerts = someloss
host = 221.6.4.66
+++ unicom-xiamen
menu = 厦门联通
title = 厦门联通
alerts = someloss
host = 36.248.249.1
+++ unicom-taiyuan
menu = 太原联通
title = 太原联通
alerts = someloss
host = 221.204.238.54
+++ unicom-guangzhou
menu = 广州联通
title = 广州联通
alerts = someloss
host = 210.21.4.130
+++ unicom-shenzhen
menu = 深圳联通
title = 深圳联通
alerts = someloss
host = 210.21.196.6
+++ unicom-nanning
menu = 南宁联通
title = 南宁联通
alerts = someloss
host = 221.7.128.68
参考链接:
https://chegva.com/528.html
http://www.xuliangwei.com/xubusi/507.html
SmokePing安装手册的更多相关文章
- Smokeping安装教程
Smokeping安装教程 #Smokeping2.6.8安装教程 #2016.3.6 改编v1.0 #Linux运维技术交流 347163978 环境 CentOS release 6.4 (F ...
- Redis安装手册
转载请注明出处:http://www.cnblogs.com/robinjava77/p/5465146.html (Robin) 1)下载redis:wget http://download.red ...
- linux下subversion server安装手册
linux下subversion server安装手册 安装基于的Linux版本为:Red Hat Enterprise Linux Server release 6.3. 一 准备需要的安装包. ( ...
- Oracle 11g R2安装手册(图文教程)For Windows
1.Oracle 11g R2安装手册(图文教程)For Windows 1.下载Oracle 11g R2 for Windows版本,下载地址如下 官方网站: http://download.or ...
- oracle 11gR2 RAC安装手册
--oracle 11gR2 RAC安装手册 -----------------------------2013/10/29 参考三思笔记 http://files.cnblogs.com/jackh ...
- entos 7虚拟机安装手册
entos 7虚拟机安装手册. 环境:VMware虚拟机软件 centos7 最小化安装包 步骤: 第一步:新建虚拟机 第二步:选择要安装的虚拟机的操作系统镜像.如我这里使用的就是CentOS7最小化 ...
- Nginx安装手册
前提是搭建yum安装环境,见前面的教程资料 Nginx安装手册1 nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. gcc 安装ngin ...
- Smokeping安装部署
稳定性检测工具smokeping安装配置和使用方法 Smokeping介绍 是对IDC网络质量,稳定性等最好的检测工具,包括常规的 ping,dig,echoping,curl等,可以监视www服务器 ...
- 泛微云桥e-Bridge安装手册
有时候不看官方文档进行配置,可能会出现奇奇怪怪的问题,SO转载一下官方文档,顺带学习. 想超长体验此软件,请搜索本博客内容,有破解方法,仅用来学习使用,顺带进行二次开发,请勿使用在商业用途,谢谢. 泛 ...
随机推荐
- 在容器中使用erase函数,迭代器的处理
在c++编程中,用到迭代器的时候,往往不知道如何删除当前迭代器指向的元素. erase函数: 返回下一个迭代器. 只使用vector的erase函数,记住,该函数是迭代器失效,返回下一个迭代器. ...
- CSS(六):盒子模型
一.什么是盒子模型 盒子模型是css中一个重要的概念,理解了盒子模型才能更好的排版. 从上图可以看到标准的盒子模型范围包括margin(外边距).border(边框).padding(内边距).con ...
- 重新=》easyui DataGrid是否可以动态的改变列显示的顺序
$.extend($.fn.datagrid.methods,{ columnMoving: function(jq){ return jq.each(function(){ var target = ...
- HTML和CSS的盒子模型(Box model)
本文作为属性篇的最后一篇文章, 将讲述HTML和CSS的关键—盒子模型(Box model). 理解Box model的关键便是margin和padding属性, 而正确理解这两个属性也是学习用css ...
- iOS开发 - CALayer图层
CALayer的基本使用 在iOS中.你能看得见摸得着的东西基本上都是UIView.比方一个button.一个文本标签.一个文本输入框.一个图标等等.这些都是UIView 事实上UIView之所以能显 ...
- WebService的初级学习
复习准备 1. Schema约束: 1.1 namespace相当于Schema文件的id: 1.2 targetNamespace属性用来指定schema文件的namespace的值; 1. ...
- 经典SQL面试题(转)
http://www.cnblogs.com/kcher90/archive/2013/03/13/2957932.html 有三个表,如果学生缺考,那么在成绩表中就不存在这个学生的这门课程成绩的记录 ...
- Shell应用之遍历回收站RecycleBin
C++ Code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...
- ELK显示多行日志
1.默认,logstash对日志文件的选取是以单行为单位的:但像log4j这种输出日志经常会是以时间头开始的多行日志: 2.显示多行,需要配置logstash的config: input { file ...
- 编程之美 set 16 拈游戏分析(1)
题目 N 个石头排成一行, 每块石头有固定的位置和编号, 两个玩家依次取石头, 每个玩家可以取其中的任一块石头, 或者相邻的两个石头. 石头在游戏过程中不能移位, 最后将剩下的石头依次取光的玩家获胜 ...