Centos6.X install smokeping
If it is 64-bit
[Root @ localhost src] # uname-
Linux localhost. localdomain 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[Root @ localhost Test] # perl-v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
Preparations
Disable iptables and selinux temporarily.
/Etc/init. d/iptables stop
/Etc/init. d/ip6tables stop
Setenforce 0
Or
Vi/etc/sysconfig/selinux
Set SELINUX = enforcing
Change to SELINUX = disabled
Effective after restart
1. Install the web Server
A yum Source
Set 163 Source
Regenerate the cache
Yum makecache
B installation support environment
Yum install httpd
Yum install httpd-devel
Yum install gcc make
Yum install perl-devel perl-Time-HiRes
Yum install rrdtool-perl
2. Install rrdtool
Library on which a rrdtool depends
The yum install libxml2-devel libpng-devel
Yum install pango-devel
Yum install libart_lgpl libart_lgpl-devel
Yum install freetype-devel fontconfig cairo-devel
Yum-y install libxml2-devel libpng-devel glib pango-devel freetype-devel fontconfig cairo-devel libart_lgpl libart_lgpl-devel
B. Install rrdtool
Wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
Tar-zxvf rrdtool-1.4.5.tar.gz
Cd rrdtool-1.4.5
./Configure -- prefix =/usr/local/rrdtool -- disable-tcl -- disable-python
Make & make install
Verify RRDTOOL after installation
/Usr/local/rrdtool/bin/rrdtool-v
The following RRDTOOL information is successfully displayed.
RRDtool 1.4.5 Copyright 1997-2010 by Tobias Oetiker <tobi@oetiker.ch>
3. Install fping
A. Install cgilib
Wget http://down1.chinaunix.net/distfiles/cgilib-0.5.tar.gz
Tar zxvf cgilib-0.5.tar.gz
Cd cgilib-0.5
Make
Cp libcgi. a/usr/local/lib
Cp cgi. h/usr/include/
B. Install fping
Wget http://oss.oetiker.ch/smokeping/pub/fping-2.4b2_to4-ipv6.tar.gz
Tar zxvf fping.tar.gz
Cd fping-2.4b2_to/
./Configure
Make & make install
Test normal
Fping-t 100 202.96.134.134
4. Install echoping
A. Install gettext
Wget http: // 42.120.20.242/gettext-0.18.1.1.tar.gz
Tar xzvf gettext-0.18.tar.gz
Cd gettext-0.18
./Configure
Make & make install
B. Install popt
Wget http: // 42.120.20.242/popt-1.7.tar.gz
Tar zxvf popt-1.7.tar.gz
Cd popt-1.7
./Configure
Make & make install
C install echoping
Wget http://jaist.dl.sourceforge.net/project/echoping/echoping/6.0.0/echoping-6.0.0.tar.gz
Tar zxvf echoping-6.0.0.tar.gz
Cd echoping-6.0.0
./Configure -- without-libidn
Make & make install
[Root @ localhost ~] # Whereis echoping
Echoping:/usr/local/bin/echoping/usr/local/lib/echoping
5. Install FCGI
Wget http://cpan.communilink.net/authors/id/F/FL/FLORA/FCGI-0.74.tar.gz
Tar zxvf FCGI-0.74.tar.gz
Cd FCGI-0.74
Perl Makefile. PL
Make & make install
6 install mod_fastcgi
Wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
Tar zxvf mod_fastcgi-2.4.6.tar.gz
Cd mod_fastcgi-2.4.6
/Usr/sbin/apxs-o mod_fastcgi.so-c *. c
/Usr/sbin/apxs-I-a-n fastcgi. libs/mod_fastcgi.so
Check whether/etc/httpd/conf/httpd. conf has
LoadModule fastcgi_module modules/mod_fastcgi.so
It may also be
LoadModule fastcgi_module/usr/lib64/httpd/modules/mod_fastcgi.so
7. Install smokeping
Wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.6.tar.gz
Tar zxvf smokeping-2.6.6.tar.gz
Cd smokeping-2.6.6
./Setup/build-perl-modules.sh/usr/local/smokeping/thirdparty
./Configure -- prefix =/usr/local/smokeping
/Usr/bin/gmake install
Solve the "checking checkingfor perl module 'rds '... Failed
Since we compile and install rrdtool, perl does not find its module in the default path and needs to be copied manually.
First search for find/-name RRDs. pm
Cp xxx/RRDs. pm/usr/lib/perl5/
Cp xxx/RRDs. so/usr/lib/perl5/
For a 64-bit server, cp to/usr/lib64/perl5/
Modify configuration file
Cd/usr/local/smokeping/bin/
Vim smokeping
Fifth line: use lib qw (); # PERL5LIB
Change to: use lib qw (/usr/local/rrdtool/lib/perl); # PERL5LIB
Cd ../etc/
Cp config. dist config
Modify configuration file
192.168.1.230 is the Server ip address (this is the http access path of smokeping)
Vim config
10 imgcache =/var/www/html/smokeping/img
11 imgurl = http: // 192.168.1.230/smokeping/img
14 cgiurl = http: // 192.168.1.230/smokeping. cgi
108 binary =/usr/local/sbin/fping
Add a monitoring site after modification
8. Configure the HTTP Runtime Environment
A. Create a directory.
Mkdir-p/var/www/html/smokeping/img/var/www/html/smokeping/script // usr/local/smokeping/data/usr/local/smokeping/var
B. Create a soft link to soft link the files in the smokping directory to the HTTP directory.
Ln-s/usr/local/smokeping/htdocs/cropper/var/www/html/smokeping/cropper
Ln-s/usr/local/smokeping/htdocs/smokeping. fcgi/var/www/html/smokeping. fcgi
C. Assign Permissions
Chown-R apache: apache/var/www/html/smokeping/
D. Modify the HTTP configuration file
Vim/etc/httpd/conf/httpd. conf
Set ServerName www.exple.com: 80
Change
ServerName localhost: 80
Comment out this line # Options Indexes FollowSymLinks
Add the following line
Options Indexes FollowSymLinks ExecCGI
Modify DirectoryIndex index.html. var
DirectoryIndex index.html. var/smokeping. fcgi
Modify AddHandler cgi-script. cgi
AddHandler cgi-script. fcgi
E. Start httpd.
Service httpd start
9 start smokeping
Chmod 400/usr/local/smokeping/etc/smokeping_secrets.dist
Nohup/usr/local/smokeping/bin/smokeping -- logfile =/var/log/smokeping. log 2> & 1 &
Perl/usr/local/smokeping/bin/smokeping -- logfile =/var/log/smokeping. log
Access http: // IP/smokeping
Solution without a diagram (personal summary ),
(1) You can use -- debug to start smokeping to check whether there is any problem.
(2) view the smokeping log
(3) Check the http error. log, which can tell you the error in many cases.
(4) View File Permissions
A. Is the data folder writable?/usr/local/smokeping/data
B. Check whether the directory of the monitored host you created is in the data folder. In this example, Test is used to check whether/usr/local/smokeping/data can be written.
C. Whether the. rrd file with the device name you created is in the Test file. In this example, it is (James. rrd)/usr/local/smokeping/data/Test
D. Check whether James. rrd will be updated every 5 minutes (mtime)/usr/local/smokeping/data/Test
E. View/var/www/html/smokeping/img folder permissions (the master and group are apache-running user master and group. The default permission is 755)
After f、starts smokeping, there are two images in the cachefolder: rrdtool.png smokeping.png/var/www/html/smokeping/img.
G. Check whether the directory of the device you created is in/var/www/html/smokeping/img. In this example, Test is used to determine the folder permissions and writability.
H. Check whether/var/www/html/smokeping/imgTest exists. Png images are updated on a regular basis. If you do not have them, they are generally permission problems.
More/usr/local/smokeping/etc/config
Imgcache =/var/www/html/smokeping/img
Imgurl = http: // 222.73.109.109/smokeping/img
Datadir =/usr/local/smokeping/data
Piddir =/usr/local/smokeping/var