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个星期的采集,历史数据库 ...
随机推荐
- 插件化框架解读之so 文件加载机制(四)
阿里P7移动互联网架构师进阶视频(每日更新中)免费学习请点击:https://space.bilibili.com/474380680 提问 本文的结论是跟着 System.loadlibrary() ...
- linux缺頁異常處理--內核空間[v3.10]
缺頁異常被觸發通常有兩種情況—— 1.程序設計的不當導致訪問了非法的地址 2.訪問的地址是合法的,但是該地址還未分配物理頁框 下面解釋一下第二種情況,這是虛擬內存管理的一個特性.盡管每個進程獨立擁有3 ...
- Nginx Web 基础入门
目录 Nginx Web 基础入门 Nginx快速安装 两种方式部署Nginx 如何升级nginx或者添加功能 使用systemd管理nginx nginx相关配置文件 nginx的配置文件详解 虚拟 ...
- go语言从例子开始之Example26.通道选择器
Go 的通道选择器 让你可以同时等待多个通道操作.Go 协程和通道以及选择器的结合是 Go 的一个强大特性. Example: package main import "time" ...
- Python中dict的特点
dict的第一个特点是查找速度快,无论dict有10个元素还是10万个元素,查找速度都一样.而list的查找速度随着元素增加而逐渐下降. 不过dict的查找速度快不是没有代价的,dict的缺点是占用内 ...
- 2019HDU多校训练第三场 Planting Trees 暴力 + 单调队列优化
题意:有一个n * n的网格,每个网格中间有一颗树,你知道每棵树的高,你可以选择一个矩形区域把里面的树都围起来,但是矩形区域里面任意两棵树的高度差的绝对值不超过m,问这个矩形的最大面积是多少? 思路: ...
- vue-cli脚手架工具新老版本安装对比
1.老版本 Shift+鼠标右键 选择打开命令窗口 1.创建项目之前,需先确保本机已经安装node 在命令窗口中执行node -v npm -v 2.一般情况下用npm安装东西比较慢,可以使用淘宝 ...
- Vue中app实例对象的几种写法
1.传统方法(练习 小DEMO中用的这种) <script type="text/ecmascript"> var app=new Vue({ el:"#ap ...
- 字符串操作——C语言实现
代码如下: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <asse ...
- js中按下回车触发事件
方法一:document.onkeydown = function (e) { // 回车提交表单// 兼容FF和IE和Opera var theEvent = window.event || e; ...