安装rrdtool和cacti遇到的问题

说明:rrdtool版本为1.6x系列,cacti版本为1.0.4

rddtool中的错误

第一个报错

checking for png_access_version_number in -lpng... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no libpng.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of libpng. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libpng and its header files. If
  you have not installed libpng, you can get it either from its original home on

     ftp://ftp.simplesystems.org/pub/libpng/png/src/

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of libpng is 1.4.8.

       LIBS=-lpcre -lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------

checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of pangocairo. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libpangocairo-1.0 and its header files. If
  you have not installed pangocairo, you can get it either from its original home on

     http://ftp.gnome.org/pub/GNOME/sources/pango/1.28

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of pangocairo is 1.28.4.

       LIBS=-lpcre -lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------

checking for pango_font_map_create_context... no
checking for xmlParseFile in -lxml2... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no libxml-2.0.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of libxml-2.0. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libxml2 and its header files. If
  you have not installed libxml-2.0, you can get it either from its original home on

     http://xmlsoft.org/downloads.html

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of libxml-2.0 is 2.7.8.

       LIBS=-lpcre -lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------

configure: error: Please fix the library issues listed above and try again.

解决办法:

**# yum install cairo-devel libxml2-devel pango pango-devel -y**

第二个报错

Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /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 Makefile.PL line 1.
BEGIN failed--compilation aborted at Makefile.PL line 1.
make[2]: *** [perl-piped] Error 2
make[2]: Leaving directory `/home/silence/tools/rrdtool-1.6.0/bindings'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/silence/tools/rrdtool-1.6.0/bindings'
make: *** [all-recursive] Error 1

解决办法

**# yum install perl-devel -y**

安装cacti遇到的错误

第三个报错

FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

解决办法:

# mysql -u root -p cacti 

官方页面给的参考如下:

The Cacti Database has not been initialized. Please initilize it before continuing.

To initilize the Cacti database, issue the following commands either as root or using a valid account.

mysqladmin -uroot -p create cacti

mysql -uroot -p -e "grant all on cacti.* to 'someuser'@'localhost' identified by 'somepassword'"

mysql -uroot -p -e "grant select on mysql.time_zone_name to 'someuser'@'localhost' identified by 'somepassword'"

mysql -uroot -p cacti < /pathcacti/cacti.sql

Where /pathcacti/ is the path to your Cacti install location.

Change someuser and somepassword to match your site preferences. The defaults are cactiuser for both user and password.

NOTE: When installing a remote poller, the config.php file must be writable by the Web Server account, and must include valid connection information to the main Cacti server. The file should be changed to read only after the install is completed.

第五个报错

MySQL TimeZone Support

ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database. Please provide the Cacti database account "select" access to the "time_zone_name" table in the "mysql" database, and populate MySQL's TimeZone information before proceeding.

解决办法:

**bash环境下执行
 mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql 
mysql环境下
mysql> use mysql;
mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
mysql> flush privileges;**

原始解决链接:
https://github.com/Cacti/cacti/issues/361

第六个问题
最后一步写入文件出现权限问题
解决办法

chown -R apache.root cacti/

第七个问题
中文乱码
解决办法:
下载新宋体,上传到服务的/usr/share/fonts/目录中
运行这条命令刷新字体
fc-cache -f -v

你可能感兴趣的:(Linux技术)