centos7.2环境下安装smokeping对网络状态进行监控
安装smokeping建议用centos7,用centos6.5一直卡在smokeping那里,下载不了perl的扩展插件,可能是因为centos6出来太久,适配的安装包和插件已经迁移了
yum groupinstall "Compatibility libraries" "Base" "Development tools" -y
yum -y install cpan perl perl-FCGI perl-CGI perl-Digest-HMAC perl-Net-Telnet perl-Net-OpenSSH perl-Net-SNMP perl-LDAP perl-Net-DNS perl-IO-Pty-Easy perl-Test-Simple perl-Sys-Syslog perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl fping 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_fcgid screen
安装echoping
tar xvf echoping-6.0.2.tar.gz
cd echoping-6.0.2
./configure --prefix=/usr/local/echoping
报错:
configure: error: Missing popt library, get it from ftp://ftp.rpm.org/pub/rpm/dist/rpm-x.y.z
解决办法:
yum install -y popt-devel
继续报错:
configure: error: Get the GNU libidn library (http://www.josefsson.org/libidn/) in order to use Unicode - multi-script - domain names or use --without-libidn to disable it
解决办法:
./configure --prefix=/usr/local/echoping --with-ssl --without-libidn
报错:
configure: error: Get the OpenSSL library (http://www.openssl.org/)
解决办法:
yum install -y openssl openssl-devel
make && make install
2.3 安装smokeping
下载地址:http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
tar -xvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
#export PERL5LIB=/usr/local/smokeping/thirdparty/lib/perl5/
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
gmake install
****************************************************************
如果./configure过程中提示找不到某些perl扩展,如下所示
checking checking for perl module‘Config::Grammar‘... Can‘t locate Config/Grammar.pm in @INC (@INC contains:/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.
请使用以下命令安装对应模块:
perl -MCPAN -e 'install Config::Grammar'
注意:有时候需要重复安装几次才能装上模块。
注意要选择国内的的模块源,不然速度很慢。
****************************************************************
2.4 创建相关目录和日志文件(因为这里的web服务器使用的是httpd,所以相关文件的属主属组均为apache)
cd /usr/local/smokeping
mkdir cache data var
touch /var/log/smokeping.log
chown apache.apache cache/ data/ var/ /var/log
2.5 创建相关配置文件
#fcgi文件
cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
#主配置文件
cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config
2.6 修改配置文件
#指定cgi的url地址为本机
sed -i 's#cgiurl = http://some.url/smokeping.cgi#cgiurl = http://192.168.3.13/smokeping.cgi#g' /usr/local/smokeping/etc/config
#指定检测的时间为60秒
sed -i 's#step = 300#step = 60#g' /usr/local/smokeping/etc/config
#指定ping的次数为60
sed -i 's#pings = 20#pings = 60#g' /usr/local/smokeping/etc/config
将step和pings都设置为60表示每60秒ping60次。
2.7 修改字符集和字体支持中文
vim /usr/local/smokeping/etc/config
***Presentation *** # 加在 ***Presentation *** 后面
charset = utf-8
yum -y install wqy-zenhei-fonts
vim /usr/local/smokeping/lib/Smo
安装smokeping建议用centos7,用centos6.5一直卡在smokeping那里,下载不了perl的扩展插件,可能是因为centos6出来太久,适配的安装包和插件已经迁移了
yum groupinstall "Compatibility libraries" "Base" "Development tools" -y
yum -y install cpan perl perl-FCGI perl-CGI perl-Digest-HMAC perl-Net-Telnet perl-Net-OpenSSH perl-Net-SNMP perl-LDAP perl-Net-DNS perl-IO-Pty-Easy perl-Test-Simple perl-Sys-Syslog perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl fping 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_fcgid screen
安装echoping
tar xvf echoping-6.0.2.tar.gz
cd echoping-6.0.2
./configure --prefix=/usr/local/echoping
报错:
configure: error: Missing popt library, get it from ftp://ftp.rpm.org/pub/rpm/dist/rpm-x.y.z
解决办法:
yum install -y popt-devel
继续报错:
configure: error: Get the GNU libidn library (http://www.josefsson.org/libidn/) in order to use Unicode - multi-script - domain names or use --without-libidn to disable it
解决办法:
./configure --prefix=/usr/local/echoping --with-ssl --without-libidn
报错:
configure: error: Get the OpenSSL library (http://www.openssl.org/)
解决办法:
yum install -y openssl openssl-devel
make && make install
2.3 安装smokeping
下载地址:http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
tar -xvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
#export PERL5LIB=/usr/local/smokeping/thirdparty/lib/perl5/
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
gmake install
****************************************************************
如果./configure过程中提示找不到某些perl扩展,如下所示
checking checking for perl module‘Config::Grammar‘... Can‘t locate Config/Grammar.pm in @INC (@INC contains:/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.
请使用以下命令安装对应模块:
perl -MCPAN -e 'install Config::Grammar'
注意:有时候需要重复安装几次才能装上模块。
注意要选择国内的的模块源,不然速度很慢。
****************************************************************
2.4 创建相关目录和日志文件(因为这里的web服务器使用的是httpd,所以相关文件的属主属组均为apache)
cd /usr/local/smokeping
mkdir cache data var
touch /var/log/smokeping.log
chown apache.apache cache/ data/ var/ /var/log
2.5 创建相关配置文件
#fcgi文件
cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
#主配置文件
cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config
2.6 修改配置文件
#指定cgi的url地址为本机
sed -i 's#cgiurl = http://some.url/smokeping.cgi#cgiurl = http://192.168.3.13/smokeping.cgi#g' /usr/local/smokeping/etc/config
#指定检测的时间为60秒
sed -i 's#step = 300#step = 60#g' /usr/local/smokeping/etc/config
#指定ping的次数为60
sed -i 's#pings = 20#pings = 60#g' /usr/local/smokeping/etc/config
将step和pings都设置为60表示每60秒ping60次。
2.7 修改字符集和字体支持中文
vim /usr/local/smokeping/etc/config
***Presentation *** # 加在 ***Presentation *** 后面
charset = utf-8
yum -y install wqy-zenhei-fonts
vim /usr/local/smokeping/lib/Smo