smokeping-2.6.11 安装部署

1. 部署环境

[root@memcached ~]# cat /etc/centos-release 
CentOS release 6.5 (Final)
[root@memcached ~]# uname -r
2.6.32-431.el6.x86_64
[root@memcached ~]# uname -a
Linux memcached 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@memcached ~]# 

 2.yum安装依赖库及环境

yum -y install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-CGI-SpeedCGI perl-Time-HiRes perl-ExtUtils-MakeMaker perl-RRD-Simple 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 mod_fastcgi screen

 3.下载安装smokeping

cd /usr/local/src/  
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
tar -zxvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping/
make
make install

 4.创建smokeping存储目录

cd /usr/local/smokeping/
mkdir cache data var
touch /var/log/smokeping.log
chown apache.apache cache/ data/ var/ /var/log/smokeping.log 

cd /usr/local/smokeping/htdocs/
mv  smokeping.fcgi.dist smokeping.fcgi
mv /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config

 5.修改smokeping配置文件

vim /usr/local/smokeping/etc/config
[root@memcached ~]# vim /usr/local/smokeping/etc/config
 *** General ***
......
 piddir  = /usr/local/smokeping/var
 cgiurl   = http://183.2.191.218/smokeping.cgi  # 访问URL
 smokemail = /usr/local/smokeping/etc/smokemail.dist
......

*** Database ***

step     = 60   # 60秒
pings    = 30   # 30个ping

*** Presentation ***
charset = utf-8          # 增加中文字符集

 6.修改密码权限为root只读

chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin

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>

 7.smokeping启动脚本

#!/bin/sh
#
# chkconfig: 2345 80 05
# Description: Smokeping init.d script
# Write by : linux-Leon_xiedi
# Get function from functions library
. /etc/init.d/functions

# Start the service Smokeping
function 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
function 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
}

#Show status about Smokeping
function status() {
        NUM="`ps -ef|grep smokeping|grep -v grep|wc -l`"
        if [ "$NUM" == "0" ];then
                echo "Smokeping is not run"
        else
                echo "Smokeping is running"
        fi
}

### main logic ###
case "$1" in

        start)
        start
        ;;

        stop)
        stop
        ;;

        status)
        status
        ;;

        restart|reload)
        stop
        start
        ;;
*)

echo $"Usage: $0
{start|stop|restart|reload|status}"

exit 1
esac
exit 0

 8.启动服务以及访问smokeping

chmod 755 /etc/init.d/smokeping
chkconfig --add smokeping
chkconfig smokeping on
chkconfig httpd on
/etc/init.d/httpd restart
/etc/init.d/smokeping restart

 9.登陆管理

10.添加需要监控的网站和节点,添加监控节点示例:注意+是第一层,++是第二层,+++ 是第三层

/usr/local/smokeping/etc/config
*** Presentation ***
charset = utf-8

template = /usr/local/smokeping/etc/basepage.html.dist

+ charts

menu = Charts
title = The most interesting destinations

++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f

++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds

++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f

++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds

+ overview

width = 1500
height = 200
range = 10h

+ detail

width = 1500
height = 200
unison_tolerance = 2

"Last 3 Hours"    3h
"Last 30 Hours"   30h
"Last 10 Days"    10d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location

*** Probes ***

+ FPing

binary = /usr/sbin/fping

*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
color=0000ff

+slave2
display_name=another
color=00ff00

*** Targets ***

probe = FPing

menu = Top
title = 监控统计
#remark = Welcome to the SmokePing website of xxx Company. \
remark = Welcome to the SmokePing website of pinhui001  Company. \
         Here you will learn all about the latency of our network.

#+ Test
#menu= Targets
#parents = owner:/Test/James location:/

#++ James
#menu = James
#title =James
#alerts = someloss
#slaves = boomer slave2
#host = james.address

#++ MultiHost
#menu = Multihost
#title = James and James as seen from Boomer
#host = /Test/James /Test/James~boomer

menu = 三大网络监控
title = 监控统计

#############################################################################
++ dianxin
menu = 电信网络监控
title = 电信网络监控列表

+++ dianxin-bj
menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133

+++ dianxin-hlj
menu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 112.100.100.100

+++ dianxin-tj
menu = 天津电信
title = 天津电信
alerts = someloss
host = 219.150.32.132

+++ dianxin-sc
menu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69

+++ dianxin-sh
menu = 上海电信
title = 上海电信
alerts = someloss
host = 202.96.209.133

+++ dianxin-gz
menu = 广东电信
title = 广东电信
alerts = someloss
host = 202.96.154.15

+++ dianxin-shlakala
alerts = someloss
host = 180.166.103.217


########################################################################
++ liantong
menu = 联通网络监控
title = 联通网络监控列表

+++ liantong-bj
menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121

+++ liantong-hlj
menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 218.7.7.18

+++ liantong-tj
menu = 天津联通
title = 天津联通
alerts = someloss
host = 60.28.250.46

+++ liantong-sc
menu = 四川联通
title = 四川联通
alerts = someloss
host = 119.6.6.6

+++ liantong-sh
menu = 上海联通
title = 上海联通
alerts = someloss
host = 220.248.17.89

+++ liantong-gz
menu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88

+++ liantong-shlakala
menu = 上海联通拉卡拉
title = 上海联通拉卡拉
alerts = someloss
host = 140.207.39.146

##########################################################################
++ yidong
menu = 移动网络监控
title = 移动网络监控列表
host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj /Other/yidong/yidong-tj /Other/yidong/yidong-sc /Other/yidong/yidong-sh /Other/yidong/yidong-gz /Ot
her/yidong/yidong-shlakala

+++ yidong-bj
menu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52

+++ yidong-hlj
menu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.34

+++ yidong-tj
menu = 天津移动
title = 天津移动
alerts = someloss
host = 211.137.160.5

+++ yidong-sc
menu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3

+++ yidong-sh
menu = 上海移动
title = 上海移动
alerts = someloss
host = 211.136.150.129

+++ yidong-gz
menu = 广东移动
title = 广东移动
alerts = someloss
host = 211.136.192.6

+++ yidong-shlakala
menu = 上海移动拉卡拉
title = 上海移动拉卡拉
alerts = someloss
host = 120.204.81.193

 11.安装点阵,图片显示文字,不然会出现乱码

yum install wqy*

 12.安装完成后。查看

 

posted @ 2016-11-01 13:25  sunmmi  阅读(382)  评论(0)    收藏  举报