Ubuntu 16.04 安装部署 Cacti

Ubuntu 16.04 安装 Cacti

Cacti 需要如下三个软件

  • RRDTool 1.0.49 or 1.2.x or greater
  • MySQL 4.1.x or 5.x or greater
  • PHP 4.3.6 or greater, 5.x greater highly recommended for advanced features
  • A web server (apache or nginx)

1.确保安装如下php扩展

  • php-mysql
  • php-snmp
  • php-ldap(when using LDAP authentication)
  • php-xml
  • php-ldap
  • php-mbstring
  • php-gmp
  • php-gd
  • php-curl

nginx+php版本

# nginx 1.10.3
# php 7.0.28
# RRDtool 1.7.0

root@cloudstack-server: php -v
PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
root@cloudstack-server:/# nginx -v
nginx version: nginx/1.10.3 (Ubuntu)

下载所有需要用到的源码包

安装 rrdtool

./configure --prefix=/usr/local/rrdtool
make && make install

解压缩 cacti 源码包,并将源码包放置于 nginx(apache) 的站点目录下

例如:nginx 1.10,配置文件:/etc/nginx/sites-available/default中找到 root 那行,显示 root var/www/html,即将cacti放置于/var/www/html目录下。

root@cacti:/# tar -zxvf cacti-release-1.1.38.tar.gz
root@cacti:/# mv cacti-release-1.1.38.tar.gz /var/www/html
root@cacti:/# mv cacti-release-1.1.38.tar.gz cacti

添加 cacti 用户

useradd cacti

授权

chown -R cacti rra/ log/

报错汇总

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.
mysql> GRANT SELECT ON mysql.time_zone_name TO cacti@localhost IDENTIFIED BY 'cacti';
mysql> flush privileges;
mysql> quit;
ERROR: Your MySQL TimeZone database is not populated. Please populate this database before proceeding.
mysql> GRANT SELECT ON mysql.time_zone_name TO cacti@localhost;
# mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root -p mysql

安装 spine

./configure
make
make install
chown root:root /usr/local/spine/bin/spine
chmod +s /usr/local/spine/bin/spine

编译安装 snipe 过程中报错

/usr/bin/ld: cannot find -lssl
apt-get install libssl-dev
configure: error: Cannot find MySQL headers.  Use --with-mysql= to specify non-default path.
sudo apt-get install libmysql++-dev

make 报错

root@cloudstack-server:/opt/cacti-spine-1.1.38# make
false // No help2man // --output=spine.1 --name='Data Collector for Cacti' --no-info --version-option='--version' ./spine
Makefile:939: recipe for target 'spine.1' failed
make: *** [spine.1] Error 1
apt-get install help2man

rrdtool 编译安装报错

./configure --prefix=/usr/local/rrdtool
make && make install
configure: error: you need either glib with g_regex support or libpcre to compile rrdtool.

https://oss.oetiker.ch/rrdtool/doc/rrdbuild.en.html

apt-get install libpango1.0-dev libxml2-dev
chown -R www-data:www-data /var/www/html/cacti/resource/
chown -R www-data:www-data /var/www/html/cacti/scripts
chown -R www-data:www-data /var/www/html/cacti/cache
chown -R www-data:www-data /var/www/html/cacti/log/

rrdtool下载地址

posted @ 2019-02-18 10:41  McSiberiaWolf  阅读(472)  评论(0)    收藏  举报