Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
rwpatterson
Valued Contributor III

Install Cacti 0.8.8h onto a CentOS 7 server in thirty minutes

Well, I didn't exactly time it, but I figure after doing it over a half dozen times, it's getting pretty easy for me. My issue was that after importing certain graph templates, I was unable to browse data sources or graphs any longer. There was absolutely nothing I could do to get the link back, so I had to blow out the cacti install and/or the MYSQL database and wing it back in. After about the fourth time I figured out it was those imports that did me in. I'll have to work on creating them from scratch because I like the way they appeared. Anyway, enough of me droning on, here's the soup to nuts install procedure. I did this on a fresh install of an older CentOS 7 .iso image on a VMware host with two 3GHz Intel cores with a 19 GB virtual drive and 3 GB of ram. It's very happy with this amount, only topping off when updating from the repos for the first time.

 

The procedure:

##### After getting the operating system started for the first time, update all packages ##### [root@CBcacti]# yum update ##### Install wget ##### [root@CBcacti]# yum install wget ##### Install EPEL repo (Extra Packages for Enterprise Linux 7 - x86_64)  ##### [root@CBcacti]# yum install epel-release [root@CBcacti]# wget http://dl.fedoraproject.o...release-7-9.noarch.rpm [root@CBcacti]# rpm -ivh epel-release-7-9.noarch.rpm ##### Install Apache ##### [root@CBcacti]# yum install httpd httpd-devel ##### Install MYSQL ##### [root@CBcacti]# yum install mariadb-server ##### Install PHP ##### [root@CBcacti]# yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli (****add 'php-ldap' for cacti-1.0.x and newer ****) [root@CBcacti]# yum install php-snmp ##### Install net SNMP ##### [root@CBcacti]# yum install net-snmp-utils net-snmp-libs ##### Install RRDTool ##### [root@CBcacti]# yum install rrdtool ##### Start Apache, MariaDB (MYSQL) and SNMP services ##### [root@CBcacti]# systemctl enable httpd.service [root@CBcacti]# systemctl start httpd.service (check with "ps -ef | grep httpd") [root@CBcacti]# systemctl enable mariadb.service [root@CBcacti]# systemctl start mariadb.service (check with "ps -ef | grep mysqld") [root@CBcacti]# systemctl enable snmpd.service [root@CBcacti]# systemctl start snmpd.service (check with "ps -ef | grep snmpd") ##### Install remi repo ("Remi's RPM repository for Enterprise Linux 7 - x86_64" for cacti) ##### [root@CBcacti]# wget http://rpms.famillecollet...ise/remi-release-7.rpm [root@CBcacti]# rpm -Uvh remi-release-7.rpm [root@CBcacti]# vi /etc/yum.repos.d/remi.repo (****for cacti, enable remi repo****) ##### Install Cacti ##### [root@CBcacti]# yum install cacti ##### Set the password for MariaDB (MYSQL) server ##### [root@CBcacti]# mysqladmin -u root password YOUR-PASSWORD-HERE <--****replace with your own password, of course**** ##### Configure MariaDB (MYSQL) settings for Cacti ##### [root@CBcacti]# mysql -u root -p Enter password: YOUR-PASSWORD-HERE <--****replace with your own password, of course**** MariaDB [(none)]> create database cacti; MariaDB [(none)]> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti'; MariaDB [(none)]> FLUSH privileges; MariaDB [(none)]> quit; ##### Install Cacti tables into MariaDB (MYSQL) ##### [root@CBcacti]# mysql -u root -p cacti < /usr/share/doc/cacti-0.8.8h/cacti.sql (****find file location with "find / -name cacti.sql"****) ##### Configure PHP settings for Cacti ##### [root@CBcacti]# vi /etc/cacti/db.php Change the below as needed for your installation: $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactiuser-password-here"; $database_port = "3306"; $database_ssl = false; ##### Configure PHP time zone settings for Cacti ##### [root@CBcacti ~]# vi /etc/php.ini Under "[DATE]", uncomment the line ";date.timezone =" and change to your time zone string like "date.timezone = America/New_York" ##### Install the time zone infomation into MariaDB (MYSQL) ##### mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root mysql -p (For the record, I could not get the above code to work for the love of money. I ended up logging the output of "mysql_tzinfo_to_sql /usr/share/zoneinfo/" into a text file in Putty, then I opened that file in a text editor, copied it and then pasted it into the table "mysql".) ##### You could configure the firewall, I just shut it off ##### [root@CBcacti]# systemctl stop firewalld [root@CBcacti]# systemctl disable firewalld To just add the web server: [root@CBcacti]# firewall-cmd --permanent --zone=public --add-service=http [root@CBcacti]# firewall-cmd --reload ##### Configure web server for cacti ##### [root@CBcacti]# vi /etc/httpd/conf.d/cacti.conf Alias /cacti    /usr/share/cacti <Directory /usr/share/cacti/>         <IfModule mod_authz_core.c>                 # httpd 2.4                 Require all granted (****change from "Require host localhost" to "Require all granted" if viewing form other than the local server****)         </IfModule>         <IfModule !mod_authz_core.c>                 # httpd 2.2                 Order deny,allow                 Deny from all                 Allow from all (****change from "Allow from localhost" to "Allow from all" if viewing form other than the local server****)         </IfModule> </Directory> ##### Restart web server for update changes to the config ##### [root@CBcacti]# systemctl restart httpd.service ##### Setting CRON for cacti ##### [root@CBcacti]# vi /etc/cron.d/cacti (****remove the leading hash (#) from the beginning of the line and save****) */5 * * * * cactiuser php /usr/share/cacti/poller.php > /dev/null 2>&1 ##### Start a browser session and log into the server at "http://YOUR-IP-HERE/cacti/" ##### Follow the prompts and enjoy

Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com

Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
0 REPLIES 0
Labels
Top Kudoed Authors