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分享的更多相关文章

  1. 001使用smokeping监控idc机房网络质量情况

    最近工作比较忙,也没有时间写博客,看到好友芮峰云最近一直在写博客,所以也手痒了,就先把之前的一些积累下来的文章分享给大家. 本文是介绍如何的使用smokeping来监控idc机房的网络质量情况,从监控 ...

  2. .net点选验证码实现思路分享

    哈哈好久没冒泡了,最进看见点选验证码有点意思,所以想自己写一个. 先上效果图 如果你被这个效果吸引了就请继续看下去. 贴代码前先说点思路: 1.要有一个汉字库,并按字形分类.(我在数据库里是安部首分类 ...

  3. Hangfire项目实践分享

    Hangfire项目实践分享 目录 Hangfire项目实践分享 目录 什么是Hangfire Hangfire基础 基于队列的任务处理(Fire-and-forget jobs) 延迟任务执行(De ...

  4. 【分享】标准springMVC+mybatis项目maven搭建最精简教程

    文章由来:公司有个实习同学需要做毕业设计,不会搭建环境,我就代劳了,顺便分享给刚入门的小伙伴,我是自学的JAVA,所以我懂的.... (大图直接观看显示很模糊,请在图片上点击右键然后在新窗口打开看) ...

  5. 【原创分享·支付宝支付】HBuilder打包APP调用支付宝客户端支付

    前言 最近有点空余时间,所以,就研究了一下APP支付.前面很早就搞完APP的微信支付了,但是由于时间上和应用上的情况,支付宝一直没空去研究.然后等我空了的时候,发现支付宝居然升级了支付逻辑,虽然目前还 ...

  6. 分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间)

    分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间) 很多时候我们都需要计算数据库中各个表的数据量和每行记录所占用空间 这里共享一个脚本 CREATE TABLE #tab ...

  7. 干货分享:SQLSERVER使用裸设备

    干货分享:SQLSERVER使用裸设备 这篇文章也适合ORACLE DBA和MYSQL DBA 阅读 裸设备适用于Linux和Windows 在ORACLE和MYSQL里也是支持裸设备的!! 介绍 大 ...

  8. Java8实战分享

    虽然很多人已经使用了JDK8,看到不少代码,貌似大家对于Java语言or SDK的使用看起来还是停留在7甚至6. Java8在流式 or 链式处理,并发 or 并行方面增强了很多,函数式的风格使代码可 ...

  9. 【开源】分享2011-2015年全国城市历史天气数据库【Sqlite+C#访问程序】

    由于个人研究需要,需要采集天气历史数据,前一篇文章:C#+HtmlAgilityPack+XPath带你采集数据(以采集天气数据为例子),介绍了基本的采集思路和核心代码,经过1个星期的采集,历史数据库 ...

随机推荐

  1. MongoDB Windows之ZIP安装

    下载.下载地址同MSI下载地址:https://www.mongodb.com/download-center/community .Package选择Zip. 下载完成后解压到对应文件夹,该文件夹就 ...

  2. FastReport.net 使用 Winform WebForm打印

    delphi用的fastreport比较多 所以.net中也研究一下用法,这个打印控件还是很简单的 只要手动设计一下写少许代码就可以打印了 甚至可以写成通用代码 以后就可以不用写代码 安装demo会同 ...

  3. [fw]awk求和

    suse11:~ # cat tmp.lst 4096 4 4096 4 4096 2 4096 4 8192 1 8192 4 8192 4 8192 4 8192 4 8192 4 8192 4 ...

  4. layui修改表格行高

    .layui-table-cell { height: auto !important; white-space: normal; }

  5. Codeforces 360E 贪心 最短路

    题意及思路:https://blog.csdn.net/huanghongxun/article/details/49846927 在假设所有边都是最大值的情况下,如果第一个人能比第二个人先到,那就缩 ...

  6. PNG文件格式

    PNG文件的组成 一个PNG文件可以看作是由多个数据块(chunk)部分组成,如同积木一样,一个数据块就是一个小积木,不同类型的积木组合搭建成了我们的PNG图像. PNG图像至少由文件署名域和三个关键 ...

  7. 前端学习(三十一)canvas(笔记)

    canvas             画布    画图.做动画.做游戏===========================================    canvas就是新标签 必须获取绘图 ...

  8. Android 混淆总结(直接copy)(转)

    转自:http://blog.csdn.net/u012188405/article/details/51985273 # Add project specific ProGuard rules he ...

  9. 使用Maven创建Web项目(转)

    转自:http://ju.outofmemory.cn/entry/49508 本文通过Maven完成一个简单的Web项目(注意,Spring配置不是重点,看看就行) 1.从Maven模板创建Web应 ...

  10. 属性.native用于解决第三方el组件库@click事件无效

    描述 有时发现用一些第三方的组件库时,例如一个封装好的button按钮<el-butten>,绑定点击事件却没有任何作用,这时便需要加 .native 原因: v-on 是对 Vue 的事 ...