Smokeping分享
Somkeping master端搭建过程
服务端/master端
一. 搭好环境,安装依赖包
(1)yum -y install httpd fping echoping curl rrdtool perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-devel perl-FCGI.x86_64 perl-CGI.x86_64 rrdtool-perl.x86_64
(echoping和perl-RadiusPerl不是必需的,如果没安上也无妨)
yum -y install httpd fping echoping curl rrdtool perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-devel perl-FCGI.x86_64 perl-CGI.x86_64 rrdtool-perl.x86_64
##核对输出信息是否除echoping和perl-RadiusPerl外其他都安装了,如果还有其他的未安装上,可以在网上搜对应的rpm安装包用rpm -ivh命令安装
查看是否已安装perl-CGI-SpeedyCGI
rpm -qa | grep perl-CGI-SpeedyCGI
(2)下载安装有关tcpping的脚本及环境
yum -y install tcptraceroute
chmod 777 /usr/bin/tcpping
chmod a+s /usr/bin/tcpping
chmod a+s /usr/bin/tcptraceroute
二.安装源码包
Config-Grammar-1.10.tar
perl-CGI-SpeedyCGI-2.22-4.el5.x86_64
smokeping-2.6.9.tar
tcping-1.3.5.tar
(2)安装
mv Config-Grammar-1.10.tar.gz /tmp/
mv smokeping-2.6.9.tar.gz /tmp/
cd /tmp/
tar -zxvf Config-Grammar-1.10.tar.gz
tar -zxvf smokeping-2.6.9.tar.gz
cd Config-Grammar-1.10
perl Makefile.PL
make && make install
安装smokeping
cd /tmp/smokeping-2.6.9
./configure --prefix=/export/smokeping
make && make install
准备配置文件
cd /export/smokeping/
mkdir cache data var
chmod 777 cache data var
cd /export/smokeping/etc/
cp config.dist config #主要配置文件#
cp basepage.html.dist basepage.html #此文件名必须与config中***Presentation***的文件名对应#
cp smokeping_secrets.dist smokeping_secrets #保存密钥的文件,此文件名必须与config中***Slaves***的文件名对应#
chmod 400 /export/smokeping/etc/smokeping_secrets #特别注意此文件的权限#
修改/etc/httpd/conf/httpd.conf
在结尾出追加以下内容:
Alias /smokeping/cache "/export/smokeping/cache/"
Alias /cache "/export/smokeping/cache/"
Alias /cropper "/export/smokeping/htdocs/cropper/"
Alias /smokeping "/export/smokeping/htdocs/smokeping.fcgi"
<Directory "/export/smokeping/">
Allow from all
Options ExecCGI
AddHandler fastcgi-script .fcgi
DirectoryIndex smokeping.fcgi
</Directory>
修改目录及文件的所属组和所属主
chown -R apache.apache /export/smokeping/
从线上机器拷贝config文件到本机/export/smokeping/etc/,直接替换原文件即可,
*** Slaves ***和*** Targets ***下面的无效配置全部删除即可
核对这几处文件是否相对应
##如果无salve端需求,可省略这一步##,将slave端主机名和密钥smsmsmsm.wy写入master端的smokeping_secrets文件中,
vim /export/smokeping/etc/smokeping_secrets
将slave端主机名写入到配置文件*Slaves*处
vim /export/smokeping/etc/config
将需要监控的目的地址写入到配置文件*** Targets ***处(配置文件中“+”为一级目录,“++”为二级目录,“+++”为三级目录)
启动脚本
root用户
cd /export/smokeping/bin/
vim start.sh
将以下内容写入: /usr/bin/perl /export/smokeping/bin/smokeping --debug-daemon --logfile=/export/smokeping/sm.log
chmod 777 start.sh
执行启动脚本即可
全程如无报错,一般五分钟后会在master端呈现出所需图像,如果有报错或者没图像,请根据报错或日志内容排查。(请注意测试一下目的端是否可达,"ping 目的IP"或者"tcpping 目的IP 目的端口")
如有故障需重启,请先杀掉进程,然后执行start.sh脚本
报错案例:
1.启动报错
ERROR: I Quit! Another copy of /export/smokeping/bin/smokeping () seems to be running.
Check /export/smokeping/var/smokeping.pid
删除 /export/smokeping/var/smokeping.pid
2.服务启动正常,smokeping日志正常,但是访问页面有500报错
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.2.15 (CentOS) Server at 192.168.2.101 Port 80
可能是目录权限有问题,chown -R apache.apache /var
也可能是需加载内容过多,多等一会就有图,新搭建的一般排除此这一可能
3.tcpping无图,-nan
tcpping 和 tcptraceroute 要chmod a+s /usr/bin/tcpping加权限否则-nan
4.启动无报错信息,smokeping日志正常,访问页面只显示/export/smokeping/htdocs/smokeping.fcgi的文件内容
#!/bin/sh
exec /export/smokeping/bin/smokeping_cgi /export/smokeping/etc/config
httpd未加载fcgi模块,在配置文件/etc/httpd/conf/httpd.conf中添加以下内容到大约200行位置,添加效果如图
LoadModule fastcgi_module /usr/lib64/httpd/modules/mod_fastcgi.so
下载模块,更改权限,重启httpd服务
wget http://172.25.91.186/smoke/mod_fastcgi.so
mv mod_fastcgi.so /usr/lib64/httpd/modules/mod_fastcgi.so
chmod 755 /usr/lib64/httpd/modules/mod_fastcgi.so
service httpd restart
5.启动后有图像,但是不支持中文
(1).页面支持中文
在配置文件congfig的*** Presentation ***下添加
charset = utf-8
(2).rrd图片支持中文
yum -y install wqy-zenhei-fonts.noarch
修改配置文件/export/smokeping/lib/Smokeping/Graphs.pm ,大约第148行位置插入这句
'--font TITLE:20:"WenQuanYi Zen Hei Mono"',
插入后效果如图,然后重启smokeping即可
Smokeping分享的更多相关文章
- 001使用smokeping监控idc机房网络质量情况
最近工作比较忙,也没有时间写博客,看到好友芮峰云最近一直在写博客,所以也手痒了,就先把之前的一些积累下来的文章分享给大家. 本文是介绍如何的使用smokeping来监控idc机房的网络质量情况,从监控 ...
- .net点选验证码实现思路分享
哈哈好久没冒泡了,最进看见点选验证码有点意思,所以想自己写一个. 先上效果图 如果你被这个效果吸引了就请继续看下去. 贴代码前先说点思路: 1.要有一个汉字库,并按字形分类.(我在数据库里是安部首分类 ...
- Hangfire项目实践分享
Hangfire项目实践分享 目录 Hangfire项目实践分享 目录 什么是Hangfire Hangfire基础 基于队列的任务处理(Fire-and-forget jobs) 延迟任务执行(De ...
- 【分享】标准springMVC+mybatis项目maven搭建最精简教程
文章由来:公司有个实习同学需要做毕业设计,不会搭建环境,我就代劳了,顺便分享给刚入门的小伙伴,我是自学的JAVA,所以我懂的.... (大图直接观看显示很模糊,请在图片上点击右键然后在新窗口打开看) ...
- 【原创分享·支付宝支付】HBuilder打包APP调用支付宝客户端支付
前言 最近有点空余时间,所以,就研究了一下APP支付.前面很早就搞完APP的微信支付了,但是由于时间上和应用上的情况,支付宝一直没空去研究.然后等我空了的时候,发现支付宝居然升级了支付逻辑,虽然目前还 ...
- 分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间)
分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间) 很多时候我们都需要计算数据库中各个表的数据量和每行记录所占用空间 这里共享一个脚本 CREATE TABLE #tab ...
- 干货分享:SQLSERVER使用裸设备
干货分享:SQLSERVER使用裸设备 这篇文章也适合ORACLE DBA和MYSQL DBA 阅读 裸设备适用于Linux和Windows 在ORACLE和MYSQL里也是支持裸设备的!! 介绍 大 ...
- Java8实战分享
虽然很多人已经使用了JDK8,看到不少代码,貌似大家对于Java语言or SDK的使用看起来还是停留在7甚至6. Java8在流式 or 链式处理,并发 or 并行方面增强了很多,函数式的风格使代码可 ...
- 【开源】分享2011-2015年全国城市历史天气数据库【Sqlite+C#访问程序】
由于个人研究需要,需要采集天气历史数据,前一篇文章:C#+HtmlAgilityPack+XPath带你采集数据(以采集天气数据为例子),介绍了基本的采集思路和核心代码,经过1个星期的采集,历史数据库 ...
随机推荐
- Cocos2d 之FlyBird开发---GameScore类
| 版权声明:本文为博主原创文章,未经博主允许不得转载. 这个类主要实现的是,显示历次成绩中的最好成绩.当然我写的这个很简洁,还可以写的更加的丰富.下面贴上代码: GameScore.h #ifn ...
- JavaScript中object和Object有什么区别
JavaScript中object和Object有什么区别,为什么用typeof检测对象,返回object,而用instanceof 必须要接Object呢 ————————————————————— ...
- luoguP1314 聪明的质监员 题解(NOIP2011)
P1314 聪明的质监员 题目 #include<iostream> #include<cstdlib> #include<cstdio> #include< ...
- Fix invisible cursor issue in Ubuntu 13.10
Fix invisible cursor issue in Ubuntu 13.10 Fixing this problem is rather too easy. Open a terminal ( ...
- spring-data-neo4j了解
本项目demo地址[请阅读readme文件]: https://gitee.com/LiuDaiHua/project-neo4j 最近项目上要搭建一个关系图谱的东西,领导给了neo4j和d3两个概念 ...
- mySQL部分疑问和小结(orale)
2015/10/15 1.mysql语句: ALTER table scfz_xewp add BGR varchar(255) after KYR 2.创建触发器时: --/ CREATE D ...
- 2019-9-2-win10-uwp-九幽图床
title author date CreateTime categories win10 uwp 九幽图床 lindexi 2019-09-02 12:57:38 +0800 2018-2-13 1 ...
- SQL如何使用快照恢复之前的数据
什么是快照 数据库快照是SQL server 2005的一个新功能.给出的定义如下 数据库快照是数据库的只读静态视图.在创建时每个数据库快照在事务上都与源数据库一致.在创建数据库快照时,源数据库通常会 ...
- Pandas之loc\iloc\ix
---------------------------------------------------------------------------------------------------- ...
- Python自动补全缩写意义
自动补全的变量的类别p:parameter 参数 m:method 方法(类实例方法)调用方式classA aa.method()或者classA().method() c:class 类 v:var ...