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即可

转载于:https://www.cnblogs.com/Su-per-man/p/8260788.html

Smokeping分享相关推荐

  1. 微信分享 | 大规模数据中心自动化运维实践

    大规模数据中心的运维实践 大家好,我是青云QingCloud 运维工程师朱峻华,在海关某单位任职数年,后又混迹多家外企,曾在IBM/EMC出现. 刚才粗略看了一下群成员,有我好几个曾经的同事,还有不少 ...

  2. 安装smokeping

    下载安装包 wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.7.3.tar.gz 编译,安装 tar xf smokeping-2.7.3. ...

  3. smokeping监控报警

    目录 报警配置 接下来编辑smokeping配置文件 General配置 Alert配置 应用报警配置 由于IDC需要监控到各个分公司及各个业务系统的网络状况,个人认为使用smokeping来做监控系 ...

  4. 妙用postman系列——postman建组、分享

    妙用postman系列--postman建组.分享 添加新的组和请求. 3.生成分享链接 4.导入分享链接

  5. 【golang程序包推荐分享】go-ini、viper、godoc

    [golang程序包推荐&分享]go-ini.viper.godoc 一.go-ini 1.程序包简介 2.下载安装 3.简单使用[截取自官网] 二.viper 1.程序包简介 2.下载安装 ...

  6. [FaceBook]测试、发布和分享小游戏

    FaceBook小游戏 测试.发布和分享小游戏 对于小游戏,您现在可以十分轻松地在本地测试开发版本,自动完成发布流程,以及与团队分享编译版本.本文档会详细说明这些步骤. 通过本地服务器测试游戏 小游戏 ...

  7. php 导航高亮,zblogphp导航高亮代码分享教程

    导航高亮如本站演示,首页.列表页.文章页均可高亮.因为本站的主题是一个免费的zblogphp主题,所以一些好的东西可能没有,所以只好自己研究,本身自带导航高亮的功能,但是只有首页和列表页才有高亮显示, ...

  8. 微信小程序分享注意点

    模拟机如下图 使用呢,文档上都有如下 这个就是小程序分享 如果想点击按钮分享也行,需要设置一下属性如下 open-type="share" 文档内容 onShareAppMessa ...

  9. 分享一个小工具:Excel表高速转换成JSON字符串

    在游戏项目中一般都须要由策划制作大量的游戏内容,当中非常大一部分是使用Excel表来制作的.于是程序就须要把Excel文件转换成程序方便读取的格式. 之前项目使用的Excel表导入工具都是通过Offi ...

最新文章

  1. 「小程序JAVA实战」小程序的举报功能开发(68)
  2. cmake,gtest单元测试程序
  3. python创建线程_多种方法实现 python 线程池
  4. myeclipse mysql 乱码_MyEclipse与mysql增改查现乱码解决方案绝对有效
  5. 月赛 SX_ACM 惨痛教训
  6. 有效数据包含额外数据_设置数据有效性的一些技巧
  7. 【ERNIE】深度剖析知识增强语义表示模型——ERNIE
  8. 基于CANape开发的XCP测量
  9. lingo的目标规划
  10. 概率模型中的 报童问题 matlab求解
  11. 银行卡四要素验证接口测试报告
  12. 与微软中国梁念坚先生商榷
  13. 2019百日打卡DAY12
  14. Springboot中自动转JSON输出
  15. 无人驾驶路径规划(三)局部路径规划-Frenet坐标系下的动态轨迹规划
  16. MySQL定时任务(每天0点自动执行)
  17. linux查看gcc/cmake/当前版本
  18. 语音amr文件转换为mp3文件
  19. reverse方向入门过程
  20. 在macOS上运行PSCN-debug

热门文章

  1. 计算机怎么输入无线网络,电脑如何建立无线网络热点上网
  2. SpringCloud-19-Spring Cloud Hystrix介绍和服务端降级
  3. 【甘道夫】升级gcc到7.3.0
  4. Spring Security是什么? - 密码认证(四)
  5. display:Weston:怎么让某个surface永远置于顶层
  6. Redis主从复制和集群配置系列之四
  7. locust利用locust-plugins插件,将结果记录到TimescaleDB数据库,用Grafana 绘制结果
  8. 程序人生 - 程序员高情商的聊天技巧
  9. 42种塑料质感Photoshop笔刷
  10. Vue前端资源本地下载(即文件放在前端目录下)