Smokeping2.6.9 centos6 version installation process installation

Preparations:
1. To prevent errors in installation dependencies, first install third-party sources to the system: rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm

2、安装lamp环境和rrdtool图形处理及其他所需依赖库:
1 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

2. Start the installation
1. Download and install the smokeping program
1 wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.9.tar.gz

1 tar -zxvf smokeping-2.6.9.tar.gz #Decompress the .tar.gz compressed package
2 cd smokeping-2.6.9 #Enter the program directory after decompression 3./configure
--prefix=/usr/local/smokeping #Install the smokeping program in /usr/local/smokeping/ under the path
##If you install the smokeping program for the first time, you will usually get an error saying that there is no perl module support and you need to execute the installer after installing the module##

1 ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty

#Install the perl module according to the error
message###If it appears when installing the perl module

1 You need to download and install perl-devel and perl-ExtUtils-Embed Centos system, you can directly yum install perl-devel perl-ExtUtils-Embed -y (In short, you need to install which plug-in if you are prompted) install it before executing./setup /build-perl-modules.sh /usr/local/smokeping/thirdparty2
2 ./configure --prefix=/usr/local/smokeping #perl execute the installer again after the module is loaded

At this point, after the installation is successful, you will be prompted to compile, compile as required

1 / usr / bin / gmake install
############## So far, the program has completed the initial installation ###################
III. Configure smokeping
1. Create three directories of cache var data and smokeping.log log file
1 cd /usr/local/smokeping
2 mkdir cache data var
3 touch /var/log/smokeping.log
2. Grant the newly created files and directories Apache permissions
1 cd /usr/local/smokeping
2 chown -R apache:apache cache data var
3 chown -R apache:apache /var/log/smokeping.log
After executing ls, check if the result is correct:

3. Modify the configuration file and automatically generate the file (the purpose is that the file location is consistent with the config configuration)
1 cd /usr/local/smokeping/htdocs/
2 mv smokeping.fcgi.dist smokeping.fcgi   
3 cd /usr/local/smokeping/ etc
4 mv config.dist config
5 vim config
##Find cgiurl = http://some.url/smokeping.cgi and change some.url to local IP or domain name##
##Find the Database column and put step (monitoring time) and Change the value of pings (number of pings) to your own setting ##### Change to 60, which means ping 60 times in 60 seconds##

4. After completion, modify the authentication password file permissions
1 chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

Fourth, modify the apache configuration

1 vim vim /etc/httpd/conf/httpd.conf
2 ####在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>

6. Set the boot to start apache and smokeping process, and close the firewall
1 echo "/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >>/etc/rc. local
2 chkconfig httpd on
3 chkconfig iptables off
Seven, start httpd and smokeping
1 service httpd restart
2 /usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log

Eight, open the web interface test

If the error "500" is returned, the selinux option is not closed

1
Change vim /etc/sysconfig/selinux to Selinux=disable or selinux=permissive
Nine, set the web user name and password
1 cd /usr/local/smokeping/htdocs
2 htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin # Set the account to admin, the password is prompted to enter after pressing Enter

###So far, the smokeping installation has been completed, the rest is to add the smokeping plugin and set its monitoring parameters ####

Install Chinese font set:
yum groupinstall chinese-*

Use a browser to visit: http://ip/smokeping
Note: The login user defaults to smokeping, and the password is the password just set.

solve:

Second, add monitoring nodes.
Add the network nodes that need to be monitored. The
monitoring node samples are as follows, note that + is the first layer, ++ is the second layer, and +++ is the third layer:
[root@localhost ~]# vi /usr/local /smokeping/etc/config

  • Other
    menu = three major network monitoring
    title = monitoring statistics
    ++ dianxin
    menu = 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-bj
    menu = Beijing Telecom
    title = Beijing Telecom
    alerts = someloss
    host = 202.96.199.133

+++ dianxin-hlj
menu = Heilongjiang Telecom
title = Heilongjiang Telecom
alerts = someloss
host = 219.147.198.242

+++ dianxin-tj
menu = Tianjin Telecom
title = Tianjin Telecom
alerts = someloss
host = 219.150.32.132

+++ dianxin-sc
menu = Sichuan Telecom
title = Sichuan Telecom
alerts = someloss
host = 61.139.2.69

+++ dianxin-sh
menu = Shanghai Telecom
title = Shanghai Telecom
alerts = someloss
host = 116.228.111.118

+++ dianxin-gz
menu = Guangdong Telecom
title = Guangdong Telecom
alerts = someloss
host = 113.111.211.22

++ liantong
menu = 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-bj
menu = Beijing Unicom
title = Beijing Unicom
alerts = someloss
host = 124.65.128.122 //This ip is the main test ip

+++ liantong-hlj
menu = Heilongjiang Unicom
title = Heilongjiang Unicom
alerts = someloss
host = 202.97.224.69

+++ liantong-tj
menu = Tianjin Unicom
title = Tianjin Unicom
alerts = someloss
host = 202.99.96.68

+++ liantong-sc
menu = Sichuan Unicom
title = Sichuan Unicom
alerts = someloss
host = 119.6.6.6

+++ liantong-sh
menu = Shanghai Unicom
title = Shanghai Unicom
alerts = someloss
host = 210.22.84.3

+++ liantong-gz
menu = Guangdong Unicom
title = Guangdong Unicom
alerts = someloss
host = 221.5.88.88

++ yidong
menu = mobile network monitoring
title = mobile network monitoring 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-bj
menu = Beijing Mobile
title = Beijing Mobile
alerts = someloss
host = 221.130.33.52

+++ yidong-hlj
menu = Heilongjiang Mobile
title = Heilongjiang Mobile
alerts = someloss
host = 211.137.241.35

+++ yidong-tj
menu = Tianjin Mobile
title = Tianjin Mobile
alerts = someloss
host = 211.137.160.5

+++ yidong-sc
menu = Sichuan Mobile
title = Sichuan Mobile
alerts = someloss
host = 218.201.4.3

+++ yidong-sh
menu = Shanghai Mobile
title = Shanghai Mobile
alerts = someloss
host = 117.131.19.23

+++ yidong-gz
menu = Guangdong Mobile
title = Guangdong Mobile
alerts = someloss
host = 211.136.192.6
Then restart smokeping
[root@localhost ~]# ps -ef | grep smoke
root 10261 1 0 20:11? 00:00 :00 /usr/local/smokeping/bin/smokeping [FPing]
root 10572 1839 0 20:55 pts/0 00:00:00 grep smoke
[root@localhost ~]# kill -9 10261
[root@localhoadminst ~]# ps -ef | grep smoke
root 10574 1839 0 20:55 pts/0 00:00:00 grep smoke
[root@localhost ~]# /usr/local/smokeping/bin/smokeping
WARNING: Hostname'james.address' does currently not resolve to an IPv6 or IPv4 address
Note: logging to syslog as local0/info.
Daemonizing /usr/local/smokeping/bin/smokeping ...
Then you can see the monitoring graph

Solution to the smokeping error:

1. The error has been resolved:
Internal Server Error 500
Apache error_log:
13) Permission denied: exec of'/usr
/local/smokeping/htdocs/smokeping.fcgi ' failed Premature end of script headers: smokeping.fcgi
File does not exist: /var/www/html/favicon.ico

Solution: selinux is not closed

2. Chinese characters cannot be displayed normally

Solution:
Windows Road King: Find a font in C:\Windows\Fonts, upload it to the server: /usr/share/fonts/dejavu, restart httpd

3. Permission error report
error message: /usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log
ERROR: /usr/local/smokeping/bin/../etc/config, line 113 : File'/usr/local/smokeping/etc/smokeping_secrets.dist' is world-readable or writable, refusing it

Solution: chmod 400 smokeping_secrets.dist

4、
报错信息:Can't locate Sys/Syslog.pm in @INC (@INC contains: /usr/local/smokeping/thirdparty/lib/perl5/x86_64-linux-thread-multi /usr/local/smokeping/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.
BEGIN failed--compilation aborted at ../lib/Smokeping.pm line 16.
Compilation failed in require.
BEGIN failed--compilation aborted.
gmake[1]: [Smokeping_probes_EchoPingSmtp.pod] 错误 2
rm Smokeping_probes_EchoPingSmtp.pod
gmake[1]: 离开目录“/root/smokeping-2.6.9/doc”
gmake:
[install-recursive] 错误 1

Solution:
yum install perl-Sys-Syslog

5. Error report: start smokeping
[root@localhost ~]# /usr/local/smokeping/bin/smokeping
ERROR: /usr/local/smokeping/bin/../etc/config, line 109: ERROR: FPing'binary' does not point to an executable
error message prompting lack of fping
installation fping
[root@localhost ~]# yum install -y fping

6. Error:

BEGIN failed--compilation aborted.
gmake[1]: [Smokeping_probes_EchoPingSmtp.pod] Error 2
rm Smokeping_probes_EchoPingSmtp.pod
gmake[1]: Leaving directory `/root/smokeping-2.6.9/doc'
gmake:
[install-recursive] Error 1

  1. yum -y install perl-Sys-Syslog

  2. yum install -y podofo

报错 1
[root@linux-node1 smokeping-2.6.11]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
Building in /usr/local/smokeping/thirdparty
--> Working on FCGI

“Fetching http://www.cpan.org/authors/id/E/ET/ETHER/FCGI-0.78.tar.gz . .. OK
==> Found dependencies: ExtUtils::MakeMaker
--> Working on ExtUtils::MakeMaker
Configuring ExtUtils-MakeMaker-7.18 ... OK
Can't locate ExtUtils/Manifest.pm in @INC (@INC contains: FatPacked::35736456=HASH(0x2214b88) /usr/local/smokeping/thirdparty/lib/perl5 /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 /usr/local/smokeping/thirdparty/bin/cpanm line 132.

解决方法:
yum install perl-ExtUtils-MakeMaker
报错 2
checking checking for perl module 'RRDs'... Can't locate RRDs.pm in @INC (@INC contains: /usr/local/smokeping/thirdparty/lib/perl5/x86_64-linux-thread-multi /usr/local/smokeping/thirdparty/lib/perl5 /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 -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Failed

Solution:
yum search all perl | grep "rrd"
yum install rrdtool-perl

Guess you like

Origin blog.51cto.com/15077784/2603673