# vi /etc/apt/sources.list
於最後加入
deb http://ftp.ro.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.ro.debian.org/debian/ stretch main
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main
#apt update
#apt upgrade
#apt install php7.0-snmp php7.0-xml php7.0-mbstring php7.0-json php7.0-gd php7.0-gmp php7.0-zip php7.0-ldap php7.0-mcrypt
# echo "date.timezone = Asia/Taipei" >> /etc/php/7.0/apache2/php.ini
# mysql -u root -p
MariaDB [(none)]> create database cacti;
MariaDB [(none)]> grant all on cacti.* to 'cactiuser'@'localhost' identified by 'password1';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
# mysql -u root -p mysql < /usr/share/mysql/mysql_test_data_timezone.sql
# mysql -u root -p -e 'grant select on mysql.time_zone_name to cactiuser@localhost'
# vi /etc/mysql/mariadb.conf.d/50-server.cnf 將下列加入底部
max_heap_table_size = 98M
tmp_table_size = 64M
join_buffer_size = 64M
innodb_buffer_pool_size = 485M
innodb_doublewrite = off
innodb_flush_log_at_timeout = 3
innodb_read_io_threads = 32
innodb_write_io_threads = 16
# systemctl status mysql apache2
下載Cacti
# wget https://www.cacti.net/downloads/cacti-latest.tar.gz
# tar xfz cacti-latest.tar.gz
# cp -rf cacti-1.1.38/* /var/www/html
# rm /var/www/html/index.html
# touch /var/www/html/log/cacti.log
# chown -R www-data:www-data /var/www/html/
# vi /var/www/html/include/config.php 變更資料庫Cacti的密碼
$database_type = 'mysql';
$database_default = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'xxxxx';
$database_port = '3306';
$database_ssl = false;
# mysql -u cactiuser cacti -p < /var/www/html/cacti.sql
# apt install snmp snmpd snmp-mibs-downloader rrdtool
# systemctl restart snmpd.service
# systemctl status snmpd.service
# ss -tulpn| grep snmp
下載及安裝Cacti-Spine
# apt install build-essential dos2unix dh-autoreconf help2man libssl-dev libmysql++-dev librrds-perl libsnmp-dev libmysqlclient-dev libmysqld-dev
# wget https://www.cacti.net/downloads/spine/cacti-spine-latest.tar.gz
# tar xfz cacti-spine-latest.tar.gz
# cd cacti-spine-1.1.38
# ./bootstrap
# ./configure
# make
# make install
# chown root:root /usr/local/spine/bin/spine
# chmod +s /usr/local/spine/bin/spine
# vi /usr/local/spine/etc/spine.conf 新增檔案,加入下列
DB_Host localhost
DB_Database cacti
DB_User cactiuser
DB_Pass password1
DB_Port 3306
DB_PreG 0
http://IP/install
安裝完成