**Edit2: Added upgrade procedure at the bottom.
**Edit3: This thread has been hanging in there so I am updating it for Ubuntu LTS 20.04
With the release of 1.0 and it not existing the the Ubuntu repo's, I found no directions that helped with the install. During several failed attempts, I finally found the right match of dependencies and libraries needed to install both Cacti and Spine versions 1.0. and up.
Items in blue can be modified to the installers preference.
Most all of these commands require root permissions and were written to be preformed by a root user. You can elevate the local users permissions by running sudo -s if permitted. Use caution when running commands with root privileges.
Installing Cacti
1. Install dependencies
2. Create a new user for cactiapt install -y apache2 php libapache2-mod-php php-mysql php-snmp php-xml php-ldap php-mbstring php-gmp snmp php-gd rrdtool mysql-server libssl-dev libphp-phpmailer dos2unix autotools-dev autoconf
3. Add the timezone tables to the MySQL databaseuseradd cactiuser
4. Access the MySQL interfacemysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
5. Create the cacti database, user, and set permissions.mysql -u root -p
6. Download and extract the Cacti packagecreate database cactidb;
CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL ON cactidb.* TO 'cactiuser'@'localhost';
GRANT SELECT ON `mysql`.`time_zone_name` TO 'cactiuser'@'localhost';
flush privileges;
exit
7. Import the cacti database filecd /opt/
wget http://www.cacti.net/downloads/cacti-latest.tar.gz
ver=$(tar -tf cacti-latest.tar.gz | head -n1 | tr -d /)
tar -xvf cacti-latest.tar.gz && mv $ver cacti
8. Configure cacti to access the databasemysql -u root -p cactidb < /opt/cacti/cacti.sql
Edit the following to match your installnano /opt/cacti/include/config.php
9. Change permissions to the cacti directory$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "<password>";
$database_port = "3306";
$database_ssl = false;
10. Change permissions to the rra and log directorieschown -R www-data:www-data /opt/cacti/
11. Create a link for the cacti web directorychown -R cactiuser /opt/cacti/rra/ /opt/cacti/log/ /opt/cacti/cache/
12. Restart MySQLln -s /opt/cacti/ /var/www/html/cacti
13. Restart Apachesystemctl restart mysql
14. Add the poller to cron.systemctl restart apache2
15. Connect to the website.echo "*/5 * * * * cactiuser php /opt/cacti/poller.php > /dev/null 2>&1" > /etc/cron.d/cacti
16. Follow the directions on the web page. You may need to alter some MySQL "minimum" settings for Cacti. The items that need to be changed will be in red text and >= value will be provided. These values may very from machine to machine but this can be used as a template.http://<ip address>/cacti
*Edit: default-time-zone added. Reference MySQL docs for assistance: https://dev.mysql.com/doc/refman/5.7/en ... pport.html
17. Restart MySQLmv /etc/mysql/my.cnf /etc/mysql/my.cnf-bkup
echo "
[mysqld]
max_heap_table_size = 1073741824
max_allowed_packet = 16777216
tmp_table_size = 134217728
join_buffer_size = 134217728
innodb_buffer_pool_size = 4294967296
innodb_doublewrite = OFF
innodb_flush_log_at_timeout = 10
innodb_read_io_threads = 32
innodb_write_io_threads = 16
default-time-zone = 'America/New_York'
" > /etc/mysql/my.cnf
18. Restart Apachesystemctl restart mysql
19. Refresh your browser window or navigate back to your Cacti installationsystemctl restart apache2
Cacti is now installed. Continue on to install Spinehttp://<ip address>/cacti
-----------------------------------------------------
Installing Spine
1. Install dependencies
2. Download spineapt install libmysqlclient-dev libssl-dev libmysqlclient-dev libsnmp-dev help2man libtool make
3. Extract the package and enter directory
4. Configurever=$(tar -tf cacti-spine-latest.tar.gz | head -n1 | tr -d /)
tar -xvf /opt/cacti-spine-latest.tar.gz
cd /opt/$ver/
5. Make./configure
6. Make installmake
*Optional* Spine is installed into the /usr/local/spine/bin directory which is not part of the system path. If you want to verify that the install worked, you will have to use the full directory.make install
You should get this in return:/usr/local/spine/bin/spine --version
7. Edit the spine configuration fileSPINE 1.0.? Copyright 2004-2017 by The Cacti Group
Modify this part of the file to match your servers settingsnano /usr/local/spine/etc/spine.conf.dist
The rest of the setting will have to be made via the web interface.DB_Host localhost
DB_Database cactidb
DB_User cactiuser
DB_Pass <password>
DB_Port 3306
8. Go to Configuration -> Settings and click on the Paths tab.
Under the Alternate Poller Path, set the following:
Click Save at the bottom right.Spine Binary File Location = /usr/local/spine/bin/spine
Spine Config File Path = /usr/local/spine/etc/spine.conf.dist
9. Last is to make spine the active poller. Switch to the Poller tab and click on the drop down menu for Poller Type.
Select spine
Click save in the bottom right.
Your Cacti and Spine installation is now complete.
###################################################################################
Upgrading
Along with the modification of the install due to the frequent releases, I also create a simple copy/paste upgrade process. This process is based on the install above so use caution if you installed in any other way. I have this saved in a txt doc with my own db/user/pass options set and just copy/paste every time I need to upgrade.
Be sure not to skip release versions. You must update all in order. Some updates have db changes and if those are skipped, later updates may fail. If you need to install a specific version, find and replace "latest" with the version number. (changing cacti-latest.tar.gz to this cacti-1.1.6.tar.gz)
Systems and installs very but I am able to preform the complete upgrade in between my 5 minute polls. This allows for no "missing" data.
#Download latest version from www.cacti.net
cd ~/
rm cacti-latest.tar.gz | rm –r cactin #removes any previous files that may have a name conflict with the new file.
wget http://www.cacti.net/downloads/cacti-latest.tar.gz
ver=$(tar -tf cacti-latest.tar.gz | head -n1 | tr -d /) #getting the version number
tar -xvf cacti-latest.tar.gz && mv $ver cacti #extracting the file and renaming the directory
chown -R www-data:www-data ~/cacti/ #changing the owner of the new directory
chown -R cactiuser ~/cacti/rra/ ~/cacti/log/ ~/cacti/cache/ #changing the owner of specific sub-directories
systemctl stop mysql apache2 #stopping the services
sed -ie "s/\$database_username =.*;/\$database_username = 'cactiuser';/g" ~/cacti/include/config.php
sed -ie "s/\$database_password =.*;/\$database_password = '<password>';/g" ~/cacti/include/config.php
sed -ie "s/\$database_default =.*;/\$database_default = 'cactidb';/g" ~/cacti/include/config.php
cp -r cacti/* /opt/cacti/ #copy the new files into your cacti directory
systemctl start mysql apache2 #starting services
#Upgrading Spine
cd /opt/
rm –r cacti-spine-* | rm cacti-spine-latest.tar.gz #removes any previous files that may have a name conflict with the new file.
wget http://www.cacti.net/downloads/spine/ca ... est.tar.gz
ver=$(tar -tf cacti-spine-latest.tar.gz | head -n1 | tr -d /) #getting the version number
tar -xvf /opt/cacti-spine-latest.tar.gz #extracting file
cd /opt/$ver/
./configure
make
make install
sed -ie "s/DB_User.*/DB_User cactiuser /g" /usr/local/spine/etc/spine.conf.dist
sed -ie "s/DB_Database.*/DB_Database cactidb /g" /usr/local/spine/etc/spine.conf.dist
sed -ie "s/DB_Pass.*/DB_Pass <password> /g" /usr/local/spine/etc/spine.conf.dist
/usr/local/spine/bin/spine --version #showing version for verification