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安装

[[email protected] ~]# cat /etc/redhat-release  #查看系统环境
CentOS Linux release 7.2.1511 (Core)
[[email protected] ~]# uname -r
3.10.0-327.18.2.el7.x86_64

[[email protected] ~]# 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    #安装所需包

[[email protected] ~]# cd /usr/local/src
[[email protected] src]# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz #下载smokeping
[[email protected] src]# tar xf smokeping-2.6.11.tar.gz    #解压
[[email protected] src]# cd smokeping-2.6.11
[[email protected] smokeping-2.6.11]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty #远程下东东,需要点时间,需要build都ok,不然编译会报错
[[email protected] 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安装了
[[email protected] 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.
[[email protected] smokeping-2.6.11]# yum -y install perl-Sys-Syslog   #缺包了,安装这个就OK
[[email protected] smokeping-2.6.11]# cd /usr/local/smokeping/   #进入smokeping安装目录
[[email protected] smokeping-2.6.11]# mkdir cache data var  #创建所需文件夹
[[email protected] smokeping-2.6.11]# touch /var/log/smokeping.log  #创建日志文件
[[email protected] smokeping-2.6.11]# chown apache.apache cache data var /var/log/smokeping.log  #修改文件属主
[[email protected] smokeping]# cd htdocs
[[email protected] htdocs]# mv smokeping.fcgi.dist smokeping.fcgi     #修改文件名
[[email protected] htdocs]# mv /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config   #添加配置文件
[[email protected] htdocs]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist    #密码配置文件只让root能访问

修改smokeping配置文件

[[email protected] ~]# sed -i 's#cgiurl   = http://some.url/smokeping.cgi#cgiurl   = http://192.168.182.152/smokeping.cgi#g' /usr/local/smokeping/etc/config
[[email protected] ~]# sed -i 's#300#60#g' /usr/local/smokeping/etc/config    #改为60,一分钟采集一次数据
[[email protected] ~]# sed -i 's#20#60#g' /usr/local/smokeping/etc/config     #改为一分钟ping60次
[[email protected] ~]# vim /usr/local/smokeping/etc/config          #添加utf-8中文字符集支持
*** Presentation ***
charset = utf-8
[[email protected] ~]# 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配置文件

[[email protected] htdocs]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd luchuangao
New password:
Re-type new password:
Adding password for user luchuangao    #设置登陆密码

[[email protected] 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启动脚本

[[email protected] 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

[[email protected] etc]# chmod 755 /etc/init.d/smokeping

启动服务访问smokeping

[[email protected] ~]# systemctl start httpd.service    #启动apache
[[email protected] ~]# /etc/init.d/smokeping start     #启动smokeping

在浏览器输入http://192.168.5182.152/smokeping,输入之前设定的密码:
效果展示,略!

中文支持及添加监控节点

如果需要展示界面支持中文,需要安装中文编码:
[[email protected] etc]# yum -y install wqy-zenhei-fonts.noarch
[[email protected] 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-xian /Unicom/Telecom/telecom-shanghai /Unicom/Telecom/telecom-sichuan /Unicom/Telecom/telecom-shenzhen /Unicom/Telecom/telecom-zhejiang /Unicom/Telecom/telecom-changsha /Unicom/Telecom/telecom-wuhan /Unicom/Telecom/telecom-jiangsu /Unicom/Telecom/telecom-chongqing /Unicom/Telecom/telecom-fujian /Unicom/Telecom/telecom-neimeng /Unicom/Telecom/telecom-xinjiang /Unicom/Telecom/telecom-guizhou /Unicom/Telecom/telecom-tianjin /Unicom/Telecom/telecom-hubei /Unicom/Telecom/telecom-beijing

+++ telecom-xian
menu = 西安电信
title = 西安电信
alerts = someloss
host = 61.150.91.55

+++ telecom-shanghai
menu =  上海电信
title = 上海电信
alerts = someloss
host = 180.169.22.226

+++ telecom-sichuan
menu = 四川电信
title = 四川电信
alerts = someloss
host = 211.149.224.160

+++ telecom-shenzhen
menu = 深圳电信
title = 深圳电信
alerts = someloss
host = 183.63.53.120

+++ telecom-zhejiang
menu = 浙江电信
title = 浙江电信
alerts = someloss
host = 122.226.223.82

+++ telecom-changsha
menu = 长沙电信
title = 长沙电信
alerts = someloss
host = 124.232.150.171

+++ telecom-wuhan
menu = 武汉电信
title = 武汉电信
alerts = someloss
host = 59.173.18.243

+++ 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-neimeng
menu = 内蒙电信
title = 内蒙电信
alerts = someloss
host = 101.53.100.113

+++ telecom-xinjiang
menu = 乌鲁木齐电信
title = 乌鲁木齐电信
alerts = someloss
host = 124.119.87.204

+++ telecom-guizhou
menu = 贵州电信
title = 贵州电信
alerts = someloss
host = 222.87.128.7

+++ telecom-tianjin
menu = 天津电信
title = 天津电信
alerts = someloss
host = 221.238.254.118

+++ telecom-hubei
menu = 十堰电信
title = 十堰电信
alerts = someloss
host = 61.183.41.197

+++ telecom-beijing
menu = 北京电信
title = 北京电信
alerts = someloss
host = 119.90.3.2

++ Mobile
menu = 移动网络监控
title = 移动网络监控列表
host =  /Unicom/Mobile/mobile-zhejiang /Unicom/Mobile/mobile-shanghai /Unicom/Mobile/mobile-tianjin /Unicom/Mobile/mobile-jinan /Unicom/Mobile/mobile-beijing /Unicom/Mobile/mobile-suzhou /Unicom/Mobile/mobile-wuhan /Unicom/Mobile/mobile-shenyang /Unicom/Mobile/mobile-quanzhou /Unicom/Mobile/mobile-xiamen

+++ mobile-zhejiang
menu = 浙江移动
title = 浙江移动
alerts = someloss
host = 211.140.143.3

+++ mobile-shanghai
menu = 上海移动
title = 上海移动
alerts = someloss
host = 117.135.137.82

+++ mobile-tianjin
menu = 天津移动
title = 天津移动
alerts = someloss
host = 117.131.207.163

+++ mobile-jinan
menu = 济南移动
title = 济南移动
alerts = someloss
host = 223.99.238.104

+++ mobile-beijing
menu = 北京移动
title = 北京移动
alerts = someloss
host = 111.13.56.26

+++ mobile-suzhou
menu = 苏州移动
title = 苏州移动
alerts = someloss
host = 112.25.230.238

+++ mobile-wuhan
menu = 武汉移动
title = 武汉移动
alerts = someloss
host = 111.47.111.229

+++ mobile-shenyang
menu = 沈阳移动
title = 沈阳移动
alerts = someloss
host = 223.100.7.69

+++ mobile-quanzhou
menu = 泉州移动
title = 泉州移动
alerts = someloss
host = 112.5.16.13

+++ mobile-xiamen
menu = 厦门移动
title = 厦门移动
alerts = someloss
host = 218.207.194.109

++ Unicom
menu = 联通网络监控
title = 联通网络监控列表
host =  /Unicom/Unicom/unicom-dalian /Unicom/Unicom/unicom-beijing /Unicom/Unicom/unicom-jinan /Unicom/Unicom/unicom-shanghai /Unicom/Unicom/unicom-henan /Unicom/Unicom/unicom-heilongjiang /Unicom/Unicom/unicom-tianjin /Unicom/Unicom/unicom-shijiazhuang /Unicom/Unicom/unicom-taiyuan

+++ unicom-dalian
menu = 大连联通
title = 大连联通
alerts = someloss
host = 218.61.8.10

+++ unicom-beijing
menu = 北京联通
title = 北京联通
alerts = someloss
host = 118.186.222.66

+++ unicom-jinan
menu = 济南联通
title = 济南联通
alerts = someloss
host = 124.133.28.7

+++ unicom-shanghai
menu = 上海联通
title = 上海联通
alerts = someloss
host = 58.246.45.89

+++ 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-shijiazhuang
menu = 石家庄联通
title = 石家庄联通
alerts = someloss
host = 110.249.209.130

+++ unicom-taiyuan
menu = 太原联通
title = 太原联通
alerts = someloss
host = 221.204.238.54

参考链接:
https://chegva.com/528.html
http://www.xuliangwei.com/xubusi/507.html

原文地址:https://www.cnblogs.com/luchuangao/p/8277262.html

时间: 2024-10-28 22:44:54

SmokePing安装手册的相关文章

Nginx安装手册以及图片服务器部署

1.      安装gcc yum install gcc 2.      安装pcre,pcre-devel 在zhoulh目录下建立source build目录 mkdir source build 进入build目录 创建pcre目录 cd pcre wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.zip pcre的版本随着时间可能会变动,可以进入 ftp://ftp.csx.cam.ac.uk/pu

为 Joomla 而生的 Kunena 论坛安装手册

查看并下载最新版本Kunena论坛,或直接下载Kunena1.7.2.如果你打算在Joomla网站中安装一个论坛,可以考虑一下Kunena论坛组件,一个为Joomla而生的免费的开源论坛组件. 安装:使用Joomla的扩展管理,浏览到下载下来的Kunena论坛组件,上传并安装,看到安装界面,点击“安装Kunena 1.7.2”,稍等一会儿,一切都OK以后完成安装. 创建菜单:使用Joomla的菜单管理,创建一个Kunena论坛“入口页面”类型的菜单项,用户可以通过这个菜单项打开查看Kunena论

Nginx安装手册

前提是搭建yum安装环境,见前面的教程资料 Nginx安装手册1 nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境.? gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c++ ? PCRE PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库.nginx的http

Oracle 11g R2安装手册(图文教程)For Windows

1.Oracle 11g R2安装手册(图文教程)For Windows 1.下载Oracle 11g R2 for Windows版本,下载地址如下 官方网站: http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_database_1of2.zip http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_database_2of2.zip 2.解压两个

zabbix2.2.2完美安装手册

安装环境:centos6.6 64bit 第一章 Zabbix简介 Zabbix是一个基于Web界面提供分布式系统监视以及网络监视功能的企业级的开源解决方案.它能监视各种网络参数,保证服务器系统的安全运营,并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题. 基本功能 数据采集方式:zabbix agent,agent(active),SNMP,SSH等 数据存储方式:RDBMS,如MySQL,Pgsql等 数据展示方式:php,web,gui 报警功能:支持报警升级 第二章 Zab

funtoo 安装手册阅读 (博客第 100 篇文章纪念)

*/--> pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;} pre.src {background-color: Black; color: White;}

Linux系统VMware-Tools安装手册

VMware-Tools安装手册 一.安装概述: 在Linux操作系统中安装VMware-Tools是一个为后续的操作提供辅助性的帮助,通过成功挂载安装这个以后,用户就可以直接从Windows桌面拖拽到Linux系统中去,这样也比较节省时间.同时安装好以后,用户就可以直接设置好Windows与Linux操作系统的"文件共享",一个文件夹里面的内容供两个操作系统使用. 本次安装是作者本人摸索安装使用的,仅供初学者参考,如有不妥的地方可以留言.谢谢! 二.安装步骤: 1.启动好自己安装好的

nginx+php 安装手册

1: wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz tar -zxvf libiconv-1.13.1.tar.gzcd libiconv-1.13.1./configure --prefix=/usr/local/libiconvmakemake install 2.获取安装文件: http://www.php.net/downloads.php php-5.4.tar.gz(版本最新)3 ./configure

最基础的 ubuntu smokeping安装

ubuntu 14.04 安装 smokeping 安装smokeping及其依赖包$ sudo apt-get install smokeping curl libauthen-radius-perl libnet-ldap-perl libnet-dns-perl libio-socket-ssl-perl libnet-telnet-perl libsocket6-perl libio-socket-inet6-perl apache2 配置apache cd /etc/apache2/c