LINUX6 Network Environment Monitoring Tool smokeping deployment

Source: Internet
Author: User
Tags cairo rrdtool install perl smokeping

smokeping Introduction

Smokeping is an open source software that monitors the state and stability of the network (which is developed by the authors of RRDtool) and can monitor the network conditions of the company's IDC, such as latency, packet loss, BGP multi-line, etc.

Smokeping will send various types of test packets to the target device and system, measure, record, and graphically display the network delay situation through the RRDtool mapping method, so as to be able to clearly determine the instant communication situation of the network;

Through the smokeping to monitor the network quality of IDC room, can be from the monitoring diagram on the delay and packet loss to tell whether the network is stable, whether it is multi-line, whether it is a BGP room and to the city's three operators network of what the situation. If there is a problem, can be targeted to deal with, if you choose a new room, you can also according to the smokeping monitoring results to determine whether the room is suitable.

It is important to note that Smokeping monitors network stability, while cacti or Zabbix monitors bandwidth usage (i.e., import and export traffic),

Smokeping deployment Process

Installing the Smokeping Dependency package

[Email protected] ~]# 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 mo d_fastcgi screen

Deploying Smokeping

[[email protected] ~]# cd/usr/local/src/#进入默认源码包存放路径 [[email protected] ~]# wget http://oss.oetiker.ch/ Smokeping/pub/smokeping-2.6.9.tar.gz #下载smokeping包 [[email protected] src]# tar XF smokeping-2.6.9.tar.gz # Unzip smokeping[[email protected] src]# CD smokeping-2.6.9 [[email protected] smokeping-2.6.9]#./setup/ Build-perl-modules.sh/usr/local/smokeping/thirdparty[[email protected] smokeping-2.6.9]#./configure-- Prefix=/usr/local/smokeping #编译smokeping到/usr/local[[email protected] smokeping-2.6.9]#/usr/bin/gmake Install[[email protected] smokeping-2.6.9]# cd/usr/local/smokeping/#进入smokeping目录 [[email protected] smokeping]# mkdir Cache data var #创建三个目录 [[email protected] smokeping]# touch/var/log/smokeping.log #创建smokeping log file [[email protected] smokeping]# chown apache.apache cache/data/var//var/log/smokeping.log #授权属主属组为apache [[ Email protected] smokeping]# cd/usr/local/smokeping/htdocs/#进入smokeping下htdocs catalog [[email protected] htdocs]# mv smokeping.fcgi.dist smokeping.fcgi #修改smokeping文件名 [[email protected] smokeping]# Mv/usr/local/smokeping/etc/config.dist/usr/local/smokeping/etc/config #修改smokeping配置文件名称

Modify the smokeping configuration file as follows:

[Email protected] smokeping]# vim  /usr/local/smokeping/etc/config cgiurl   = http://192.168.1.120/ smokeping.cgi  #配置smokeping主机地址 * * * Database ***step     =      #默认检测时间300秒修改60秒pings    =      #默认ping20次, Modified to 60 seconds ping60 times * * * Presentation ***charset = utf-8    #在presentation添加utf-8 Chinese character set

The permission to modify the smokeping password file is root

[Email protected] smokeping]# chmod 600/usr/local/smokeping/etc/smokeping_secrets.dist

Set smokeping login Password Authentication

[Email protected] htdocs]# htpasswd-c/usr/local/smokeping/htdocs/htpasswd darkernew password:re-type New password: Adding Password for user darker

Modify the Apache configuration file, configure the smokeping site

[Email protected] ~]# vim/etc/httpd/conf/httpd.conf#servername www.example.com:80  # Add the following line below this line, Otherwise the boot will be error servername Localhost:80documentroot "/var/www/html"   #在这行下面添加如下---Red's representative password Authentication 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 noneoptions AllAddHandler cgi-script. fcgi. Cgiorder allow,denyallow from Allauthname "smokeping" AuthType basicauthuserfile/usr/local/smokeping/htdocs/ Htpasswdrequire Valid-userdirectoryindex smokeping.fcgi</directory>

Create a smokeping startup script that allows Smokeping to start, stop, restart, boot, etc.

[[email protected] ~]# cat/etc/init.d/smokeping #!/bin/bash## chkconfig:2345, 05# description:smokeping init.d s cript# Write by:goser# Get function from functions Library. /etc/init.d/functions# Start the service smokepingfunction start () {echo-n "Starting smokeping:"/usr/local/smokeping/ Bin/smokeping >/dev/null 2>&1### Create The lock file # # #touch/var/lock/subsys/smokepingsuccess $ "smokeping Startup "echo}# Restart the Service smokepingfunction Stop () {echo-n" stopping smokeping: "Kill-9 ' PS ax |grep"/usr/loca L/smokeping/bin/smokeping "|grep-v grep | awk ' {print '} ' >/dev/null 2>&1### now, delete the lock file # # # #rm-F/var/lock/subsys/smokepingsuccess $ "Sm okeping shutdown "echo} #Show status about smokepingfunction 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 "$" insta RT) Start; stop) stop;;   Status status;; restart|reload) stop start;; *) echo $ "Usage: $ Start|stop|restart|reload|status}" exit 1;; Esacexit 0

Start the httpd, smokeping service, and set it to boot from

[Email protected] ~]# chmod 755/etc/init.d/smokeping   #添加脚本755权限 [[email protected] ~]# chkconfig--add smokeping
    #将smokeping加入开机启动 [[email protected] ~]# chkconfig smokeping on   #设置smokeping为开机启动 [[email protected] ~]# Chkconfig httpd on    #设置apache为开机启动 [[email protected] ~]#/etc/init.d/httpd start    #启动apache服务 [[email protected] ~]#/etc/ init.d/smokeping Start   #启动smokeping服务

Add a site or service host that needs to monitor network status

To add a site or host IP address, can only be added to the smokeping configuration file, cannot be added through the Smokeping Web interface, after the site has been added to restart Smokeping, will/usr/local/smokeping/data Under Add the Moniter folder, which contains the website sub-folder

Note the addition of the Monitoring node is: + is the first layer, + + is the second tier, + + + is the third tier

+Othermenu=three major network monitoring title=Monitoring Statistics++Dianxinmenu=Telecom Network monitoring title=Telecom Network Monitoring list host=/other/dianxin/dianxin-bj/other/dianxin/dianxin-hlj/other/dianxin/dianxin-tj/other/dianxin/dianxin-sc/other/ dianxin/dianxin-sh/other/dianxin/dianxin-GZ+ + dianxin-Bjmenu=Beijing Telecom Title=Beijing Telecom Alerts=Somelosshost= 202.96.199.133 + + + dianxin-Hljmenu=Heilongjiang Telecom Title=Heilongjiang Telecom Alerts=Somelosshost= 219.147.198.242 + + + dianxin-Tjmenu=Tianjin Telecom Title=Tianjin Telecom Alerts=Somelosshost= 219.150.32.132 + + + dianxin-Scmenu=Sichuan Telecom Title=Sichuan Telecom Alerts=Somelosshost= 61.139.2.69 + + + dianxin-Shmenu=Shanghai Telecom Title=Shanghai Telecom Alerts=Somelosshost= 116.228.111.118 + + + dianxin-Gzmenu=Guangdong Telecom Title=Guangdong Telecom Alerts=Somelosshost= 113.111.211.22 + +Liantongmenu=Unicom Network Monitoring title=Unicom Network Monitoring list host=/OTHER/LIANTONG/LIANTONG-BJ/OTHER/LIANTONG/LIANTONG-HLJ/OTHER/LIANTONG/LIANTONG-TJ/OTHER/LIANTONG/LIANTONG-SC /other/liantong/liantong-sh/other/liantong/liantong-GZ+ + liantong-Bjmenu=Beijing Unicom Title=Beijing Unicom Alerts=Somelosshost= 61.135.169.121 + + + liantong-Hljmenu=Heilongjiang Unicom Title=Heilongjiang Unicom Alerts=Somelosshost= 202.97.224.69 + + + liantong-Tjmenu=Tianjin Unicom title=Tianjin unicom Alerts=Somelosshost= 202.99.96.68 + + + liantong-Scmenu=Sichuan unicom title=Sichuan unicom Alerts=Somelosshost= 119.6.6.6 + + + liantong-Shmenu=Shanghai Unicom title=Shanghai Unicom Alerts=Somelosshost= 210.22.84.3 + + + liantong-Gzmenu=Guangdong Unicom Title=Guangdong Unicom Alerts=Somelosshost= 221.5.88.88 + +Yidongmenu=Mobile network monitoring title=Mobile Network Monitor list 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+ + yidong-Bjmenu=Beijing Mobile Title=Beijing Mobile Alerts=Somelosshost= 221.130.33.52 + + + yidong-Hljmenu=Heilongjiang Mobile Title=Heilongjiang Mobile Alerts=Somelosshost= 211.137.241.35 + + + yidong-Tjmenu=Tianjin Mobile Title=Tianjin Mobile Alerts=Somelosshost= 211.137.160.5 + + + yidong-Scmenu=Sichuan Mobile Title=Sichuan Mobile Alerts=Somelosshost= 218.201.4.3 + + + yidong-Shmenu=Shanghai Mobile Title=Shanghai Mobile Alerts=Somelosshost= 117.131.19.23 + + + yidong-Gzmenu=Guangdong Mobile Title=Guangdong Mobile Alerts=Somelosshost= 211.136.192.6
Add a site for three major carriers

If the added site is in effect, you must restart the Smokeping service (because the smokeping configuration file has been modified)

[Email protected] smokeping]#/etc/init.d/smokeping restart  

Finally access the Smokeping monitoring page through the browser: http://192.168.1.120/smokeping this time the page may be garbled, because the Chinese font is not loaded, and then add a font for smokeping

Install fonts: yum-y Install Wqy-zenhei-fonts.noarch

Edit graphs.pm:

vim/usr/local/smokeping/lib/smokeping/graphs.pm# line 147th below inserts '--font title:20: ' Wenquanyi Zen Hei Mono ',

After the page is refreshed, the Chinese display is normal and the Smokeping page is displayed as follows:

LINUX6 Network Environment Monitoring Tool smokeping deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.