I. Overview
Recently, the product always reports an IP packet loss from the partner hosting the server to the server room during peak hours. I tested that the target IP address is indeed packet loss (one packet loss is not lost in the same network segment), but the ping to other portal websites is normal, if the partner is a Chinese network equipment magnate, is there a problem with their network? After debugging, they thought my network was faulty. I contacted the IDC room (the best in China) the IDC network has been detected for a few days and the IDC network is normal.
Amazing !!! The owner must find out the cause and point of packet loss. No way is to ask SmokePing to give me the answer for monitoring .... Next we will go to the topic to build the SmokePing practice!
1. Environment
Centos5.8 64bit
Installation environment
Http rrdtool fping smokeping CGI-SpeedyCGI
Ii. installation environment
1. Update yum Source
rpm -Uvh http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
2. yum installation environment
yum -y install gcc gcc-* make man file vim-enhanced openssh-clients lftp ftp wget curl elinks httpd httpd-devel expect ntp pango system-config-network-tui libxml2-devel libpng-devel pango pango-devel libart_lgpl libart_lgpl-devel freetype freetype-devel fontconfig cairo cairo-devel sendmailyum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGIyum install fping echoping
3. Install rrdtool
Wget http://bcs.duapp.com/xiueli/rrdtool.tar.gztar zxvf rrdtool.tar.gz mv rrdtool/usr/local/ln/usr/local/rrdtool/bin/rrdtool/usr/bin # rrdool of this package is 1.4.5 compiled/usr/ local/rrdtool/bin/rrdtool # You can view the version
4. Install smokeping
Wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz
Tar zxvf smokeping-2.4.2.tar.gz
Music smokeping-2.4.2/usr/local/smokeping
5. Configure smokeping (this step is the most difficult to build smokeping)
cp /usr/local/smokeping/bin/smokeping.dist /usr/local/smokeping/bin/smokepingcp /usr/local/smokeping/htdocs/smokeping.cgi.dist /usr/local/smokeping/htdocs/smokeping.cgimkdir -p /usr/local/smokeping/htdocs/imgmkdir -p /usr/local/smokeping/var
Vim/usr/local/smokeping/bin/smokeping content is as follows #! /Usr/bin/perl-w #-*-perl-*-use lib qw (/usr/local/rrdtool/lib/perl /); # change use lib qw (/usr/local/smokeping/lib/); * change use strict; use warnings; use Smokeping 2.004002; Smokeping :: main ("/usr/local/smokeping/etc/config. dist "); # Change vim/usr/local/smokeping/htdocs/smokeping. cgi # change, or the above three places #! /Usr/bin/speedy #-*-perl-*-use strict; use warnings; use lib qw (/usr/local/rrdtool/lib/perl /); use lib qw (/usr/local/smokeping/lib/); use CGI: Carp qw (fatalstobroing); use Smokeping 2.004002; Smokeping :: cgi ("/usr/local/smokeping/etc/config. dist ");
The most important config. dist Configuration
See http://www.yinxiulei.cn/smokepingconfiguration file. html
6. Set the logon Password
htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin
7. apache configuration
Vi/etc/httpd/conf. d/smkeping. conf # Add ServerAdmin 627526297@qq.com DocumentRoot "/usr/local/smokeping/htdocs" ServerName localhost <Directory "/usr/local/smokeping/htdocs"> Options FollowSymLinks ExecCGI AllowOverride None AddHandler cgi -script cgi Order allow, deny Allow from all AuthName "Smokeping" AuthType Basic AuthUserFile/usr/local/smokeping/htdocs/htpasswd Require valid-user ErrorLog logs/smokeping-error_log CustomLog logs/smokeping-access_log combined
Iii. Start the server
/etc/init.d/httpd start/usr/local/smokeping/bin/smokeping start
Open the website normally
http://ip/smokeping/smokeping.cgi
Ps Problem Solving
Check the imgcache in the configuration file.
Check whether there is data in the imgcache directory and whether the directory is in htdocs.