How to Install Cacti (Network Monitoring) Tool on RHEL Systems

The Cacti tool is an open-source, web-based solution for network monitoring and system graphing in IT businesses. Cacti allows users to poll services regularly to create graphs using RRDtool.

It’s typically used to graph time-series data for metrics like network bandwidth utilization, CPU load, running processes, disk space, and more.

In this how-to, we will demonstrate how to install and set up a comprehensive network monitoring application called Cacti using the Net-SNMP tool on RHEL-based distributions such as CentOS Stream, Fedora, Rocky, and Alma Linux, using the YUM and DNF package manager tools.

Cacti Required Packages

The Cacti required the following packages to be installed on your Linux operating system.

  • Apache : A Web server to display network graphs created by PHP and RRDTool.
  • MySQL : A Database server to store cacti information.
  • PHP : A script module to create graphs using RRDTool.
  • PHP-SNMP : A PHP extension for SNMP to access data.
  • NET-SNMP : An SNMP (Simple Network Management Protocol) is used to manage the network.
  • RRDTool : A database tool to manage and retrieve time series data like CPU load, Network Bandwidth, etc.

For demonstration purposes, we used Rocky Linux 9 to install the Cacti tool, but the same instructions work for all RHEL-based distributions.

Step 1: Install Required Packages in Linux

First, begin by updating your system’s package repository to ensure you have the latest versions of software packages available.

sudo dnf update

Next, install the necessary packages for Cacti and its dependencies using the following command.

sudo dnf install net-snmp-utils net-snmp-libs rrdtool php-mysqlnd php-snmp php-xml php-gd mariadb-server httpd
Install Cacti Required Packages
Install Cacti Required Packages

Step 2: Install Cacti Tool in Linux

To install Cacti, make sure that the EPEL repository is enabled on your system.

sudo yum install epel-release

Once the EPEL repository is enabled, you can install Cacti by running the following command.

sudo yum install cacti
Install Cacti in Linux
Install Cacti in Linux

Step 3: Secure MariaDB Database

To configure MySQL for Cacti, we must first secure the newly installed MySQL server and then create the Cacti database with the user “Cacti“. If your MySQL is already installed and secured, you don’t need to do this again.

sudo mysql_secure_installation

Follow the prompts to set up a root password, remove anonymous users, disallow remote root login, and remove the test database.

Secure MySQL Installation
Secure MySQL Installation

Step 4: Create Cacti Database

Log in to the MySQL server using the newly created password, and then create the Cacti database with the user “Cacti” setting a password for it.

sudo mysql -u root -p
CREATE DATABASE cacti;
CREATE USER 'cacti'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Create Cacti Database
Create Cacti Database

Next, you need to import the default Cacti database schema into the newly created database, but before that, you need to find out the database file path using the rpm command and import it as shown.

sudo rpm -ql cacti | grep cacti.sql
sudo mysql -u cactiuser -p cacti < /usr/share/doc/cacti/cacti.sql
Import Cacti Database
Import Cacti Database

Step 5: Configure Cacti Database Connection

To configure the Cacti database connection, you need to open the configuration file as shown.

sudo vi /etc/cacti/db.php

Update the following lines with your database information.

$database_type     = 'mysql';
$database_default  = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cacti';
$database_password = 'your_password';
Configure Cacti Database Settings
Configure Cacti Database Settings

Step 6: Configure Apache for Cacti

Open a file called /etc/httpd/conf.d/cacti.conf with your choice of editor.

sudo vi /etc/httpd/conf.d/cacti.conf

Add the following lines to the file:

Alias /cacti /usr/share/cacti
<Directory /usr/share/cacti/>
    Options +FollowSymLinks
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order Deny,Allow
        Deny from all
        Allow from all
    </IfModule>
</Directory>

Save and close the file.

Finally, restart the Apache and MariaDB services to apply the changes.

sudo systemctl restart httpd
sudo systemctl restart mariadb

Step 7: Configure Cacti Cron Job

Now open the crontab file to schedule polling intervals for Cacti.

sudo vi /etc/cron.d/cacti

Remove the comment from the following line. The poller.php script runs every 5 minutes to gather data from known hosts, which Cacti uses to create graphs.

*/5 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Step 8: Access Cacti Web Interface

To access the Cacti web interface, you need to open port 80 on the firewall to allow inbound traffic on that port.

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload

You can now access Cacti via a web browser using the server’s IP address or domain name as shown.

http://your_server_ip/cacti
OR
http://domain.com/cacti

Now, follow the on-screen instructions to complete the installation process

User: admin
Password: admin
Cacti User Login
Cacti User Login

Next, change the default Cacti password.

Change Cacti Admin Password
Change Cacti Admin Password

Accept Cacti License Agreement.

Accept Cacti License Agreement
Accept Cacti License Agreement

Next, the screen shows Pre-installation Checks for Cacti installation, please correct the suggested settings in your /etc/php.ini file as shown and restart Apache after making changes.

memory_limit = 800M
max_execution_time = 60
date.timezone = Asia/Kolkata
Cacti Pre-installation Checks
Cacti Pre-installation Checks

Similarly, you also need to grant access to the MySQL TimeZone database for user Cacti, so that the database is populated with global TimeZone information.

mysql> use mysql;
mysql> GRANT SELECT ON mysql.time_zone_name TO cacti@localhost;
mysql> flush privileges;
Cacti MySQL Pre-Installation Checks
Cacti MySQL Pre-Installation Checks

Please choose the installation Type as “New Install“.

Select Cacti Installation Type
Select Cacti Installation Type

Make sure all the following directory permissions are correct before continuing.

Cacti Directory Permission Checks
Cacti Directory Permission Checks

Make sure all of these Critical Binary Locations and Versions values are correct before continuing.

Critical Binary Locations and Versions
Critical Binary Locations and Versions

Please choose the default Data Source Profile to be used for polling sources.

Select Data Source Profile
Select Data Source Profile

Please, choose the Device Templates that you wish to use after the Cacti Install.

Select Cacti Device Templates
Select Cacti Device Templates

Set the Server Collation in your MySQL configuration file /etc/my.cnf under the [mysqld] section as shown.

[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
Set Server Collation
Set Server Collation

Your Cacti Server is almost ready. Please confirm that you are happy to proceed.

Cacti Installation Process
Cacti Installation Process
Installing Cacti Server
Installing Cacti Server
Cacti Dashboard
Cacti Dashboard

Congratulations! You have successfully installed Cacti on RHEL-based systems. You can now start monitoring your network infrastructure by adding devices, creating graphs, and setting up alerts within the Cacti web interface.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

383 Comments

Leave a Reply
  1. Hi, Please help. I have done everything right. All commands are executed without errors. For some reason. I cannot go past the “your mysql database is not populated” please help.

    Reply
  2. I am facing this issue with mysql error when try to deploy it.

    1. ERROR: Your MySQL TimeZone database is not populated. Please populate this database before proceeding.
    2. Mysql and mysql setting is facing the error. the few things I have manually configured in the maria DB setting. now I revert to the default setting. what else I have to do for this final activation.
    Reply
  3. This guide is much easier to follow than the manual on Cacti, thank you. I’m having trouble with the Pre-Installation Checks. I went into the /etc/php.ini and changed the three settings you say to, but it only corrects the errors on the PHP (cli) section, not the (web) section. I’ve restarted apache about a dozen times, restarted MariaDB, and it’s not recognizing it. I can’t continue to the next section from here.

    Reply
  4. Thanks for the tutorial, but it was not so easy for me since it was no more than the first login, and what I did was edit the following file:

    # vim /etc/php.ini
    

    and look for the line that says: session.auto_start = 0 and changed it to: session.auto_start = on.

    and went on with the installation.

    Reply
  5. I have installed this by following all the steps. But when I try to login with admin/admin nothing happens. I can’t see any error in the logs.

    Any idea?

    Reply
      • I found the solution on login with the user “admin” and password admin. Add two // on this line: $cacti_cookie_domain = ‘cacti.net’; found here: ~$ sudo nano /usr/share/cacti/include/config.php

        Reply
  6. Hi,

    I changed the date.timezone = “Asia/Kabul” in php.ini but still when I open cacti shows the date.timezone error, please help me to solve this issue.

    Reply
  7. Dear Ravi,

    I am new in Cacti and just following your step to install Cacti. I got /usr/share/cacti/log/ “Not writable” at Installation Wizard page. I have tried chown -R apache.apache /usr/share/cacti/log/ and chown -R root.root /usr/share/cacti/log/ still cannot not fix the issue and cannot continue “next” step. Please help

    Reply
  8. Forbidden

    You don’t have permission to access /cacti/ on this server.

    I am facing this error while visit http://localhost/cacti/.

    Please give me solutions.

    Thanks.

    Reply
    • @Dev,

      Please check your Cacti installation and also enable access to IP address on Apache. If you still get same error, check the logs for solution.

      Reply
  9. I have an error, while running the following command.

    # mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
    

    Please how to to do fix?

    Reply
  10. I ran into the below error.

    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.

    and I followed these following instructions to resolve.

    # mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
    mysql> use mysql;
    mysql> GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
    mysql> flush privileges;
    
    Reply
  11. Thanks for your post. You can add epel repo installation to the post for CentOS7 with “yum install epel-release -y”

    Reply
  12. Hi, could you updated this guide for the latest version of cacti? seem there are some file permission needed for it to install the template.

    Reply
  13. Hi Ravi,

    Great article, thank you.

    It is just that I got stuck in running the Cacti installer. When I go to http://127.0.0.1, I got the infamous “You don’t have permission to access /cacti/ on this server” error.

    I read through the documentation and various forums but it seems I cannot understand what is wrong and cannot get pas this error.

    My /etc/httpd/conf.d/cacti.conf is:

    --------
    Alias /cacti    /usr/share/cacti
    
    
            
                    # httpd 2.4
                    Require all granted
            
            
                    # httpd 2.2
                    Order allow,deny
                    # Deny from all
                    Allow from 192.168.1.0/24
            
    
     -------
    

    My network is 192.168.1.x network and I am running Fedora 27 on x86_64.

    Any ideas on what I am missing?

    Thank you.

    Reply
    • @Tolga,

      Please add the following lines to your cacti.conf file and restart the apache server.

      Alias /cacti    /usr/share/cacti
      
      <Directory /usr/share/cacti/>
              <IfModule mod_authz_core.c>
                      # httpd 2.4
                      Require all granted
              </IfModule>
              <IfModule !mod_authz_core.c>
                      # httpd 2.2
                      Order deny,allow
                      Deny from all
                      Allow from all
              </IfModule>
      </Directory>
      
      Reply
  14. mysql -u cacti -p raju < /usr/share/doc/cacti-1.1.28/cacti.sql
    Enter password:
    ERROR 1044 (42000): Access denied for user 'cacti'@'localhost' to database 'raju'

    hi. I am getting the above error. can you please help me with this?

    Reply
  15. Hi,

    Getting below error, please advise, thanks

    # mysql -u cacti -p cacti < /usr/share/doc/cacti-1.1.24/cacti.sql
    Enter password:
    ERROR 1045 (28000): Access denied for user 'cacti'@'localhost' (using password: YES)

    Forbidden

    You don't have permission to access /cacti on this server.

    Reply
      • i create the database but still, i am getting the error.

        MariaDB [(none)]> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY ‘raju’; Query OK, 0 rows affected (0.02 sec)

        is that ok?

        Reply
        • @Raju,

          Yes the MySQL query for granting permission on Cacti database to user cacti is correct. Could you please check the logs or post error here?

          Reply
  16. Hi, I am install cacti successfully, but when i install plug-ins, it can’t work and i am install older version of cacti it is work fine please resolve this issue.

    Reply
  17. If I want use domain-name to access to my cacti server, instead of ip address. How could we do this?

    For example: cacti.abc.com, instead of typing my ip address 192.168.X.X.

    Thanks

    Reply
    • @Danza,

      Create a local virtualhost on Apache and point DocumentRoot to Cacti directory and in your desktop machine add local domain to hosts file.

      Reply
    • @Maurin,

      First, you need to enable EPEL Repository in your system to install Cacti package.

      # yum install epel-release
      # yum install cacti
      
      Reply
  18. when entering on browser

    http://myIP/cacti then it’s showing

    This page isn’t working
    103.74.227.22 is currently unable to handle this request.
    HTTP ERROR 500

    but when I enter
    http://myIP/cacti/install
    then install screen appears.

    what could be the problem, and how to get rid of it.
    Note: I turned off my firewall still the same problem.

    Reply
  19. I am getting an error.

    Error: your MYSQL timezone database is not populated. please populate the database before proceeding

    I found many solutions on via google but none is working for me.
    the most popular solutions are

    1) shell> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

    when I run the above command it shows an arrow like this ( —-> ), after that I don’t know what to do.

    2) second solution was
    grant select on mysql.time_zone_name to cacti@localhost identified by ‘**your pass**)

    when I run this second solution command it accepts it but still error is same.

    please help ASAP

    Reply
    • @Sam,

      Try these commands to fix that MYSQL timezone database is not populated error.

      # cd cacti/cli
      # php repair_database.php --force
      # php upgrade_database.php
      

      it will solve your problem..

      Reply
      • thanks for the reply

        now I am having an error at cacti installation wiz screen as

        Spine Binary File Location: The path to Spine binary.

        /usr/local/spine/bin/spine (X)

        means there is some problem with the location of the file or maybe the file is not on correct location, or maybe the file is not present on the server

        Reply
        • i found out that i have to install the spine manually done installing it and configuring it
          im not getting how to set spine file location

          second main issue im facing is that snmp queries not writable error at directory permissions checks screen

          i saw a video a person entered command
          # chown -R apache:apache cacti
          and the issue got resolved ..but he entered this command in a directory names as “html” . may be he created it or whatever ..i cant find this directory

          please help

          Reply
  20. my cron job never runs. If I run it mannually I get following error:

    [root@7cacti share]# cacti php -q /usr/share/cacti/poller.php
    bash: cacti: command not found
    [root@7cacti share]#
    
    Reply
  21. Thanx Ravi! Everything is working great so far with one hiccup. All the devices report ‘Up’. I add the create graphs for the device but when I view the graphs they are all blank. However, if I click on the graph in real-time the graph is populated. I am not sure what to do at this point any ideas?

    Thanks
    jack

    Reply
  22. Hello,

    I having this error “FATAL: Cannot connect to MySQL server on ‘localhost‘. Please make sure you have specified a valid MySQL database name in ‘include/config.php‘ ” When I tried to connect the webserver. I am installing in a hyper-V enviorment with host also in same subnet . Do I need to change anything from the above? the “localhost ” would remain the same right ?

    Reply
  23. Ravi,

    Maybe it’s just me but to get back to the last comments in this thread on your webpage I’ve had to hit the newer comments button literally about 15 times. You really need a button that takes everyone to the end.

    Reply
    • @Jason,

      Actually its difficult to show all comments in one page, it will make the page bigger in size and leads to slow loading, that’s the reason we have to break the comments into pages for easier navigation..

      Reply
  24. Nick,

    In the instructions
    GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY ‘tecmint’;
    So you might want to try the password “tecmint” versus “YES”

    Reply
    • @Jason,

      I think Cacti installation was not successful, try to follow the instructions again carefully and see, if you still gets same error try to view the logs files of cacti and see what error it showing there?

      Reply
  25. I seemed to have missed something. When I type: [root@tecmint ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
    (This is the correct location of the cacti.sql db on my machine)

    Where is that password coming from? Am I creating a user called cacti on the local machine? I tried editing the db.php so that the $database_username was 'cacti' and the password was [password] but I get access denied when I use that password. I also tried creating a user on the local host named 'cacti' and giving it a password but I get the same error.

    Reply
    • Just to be clear, the error I get after attempting to use any passwords I’ve set is:
      ERROR 1045 (28000): Access denied for user ‘cacti’@’localhost’ (using password: YES)

      Reply
    • @Nick,

      Have you followed Set MySQL Password and Create MySQL Cacti Database sections in the article carefully? if not try to follow these steps and set root password (if not set) and create cacti user as shown…then you can able to import cacti database to cacti db..

      Reply
  26. Dear Support,

    I have a problem on show cacti.log on cacti. It say “Error /usr/share/cacti/log/cacti.log is not readable“. I try to give full permission to user apache and cacti but it still got same error.

    [root@localhost log]# ll /usr/share/cacti/log/cacti.log
    -rwxrwxrwx. 1 apache cacti 1606 Nov 26 03:00 /usr/share/cacti/log/cacti.log

    Reply
  27. Hi, i am from Paris and i followed your tutorial, i have this error at this step ;

    mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql

    Enter password: (what is the password ???)

    ERROR 1045 (28000): Access denied for user 'cacti'@'localhost' (using password: YES)

    Could you help me ? I use CentOS 7.2

    Reply
    • I have the same error. I think it has something to do with the way the guide sets the username compared to the default username but I can’t figure it out.

      Reply
  28. Hi,

    I have configured cacti. It was asking for the login details as well but at the password change page it is showing below error:

    “The requested URL /auth_changepassword.php was not found on this server.”

    Please suggest.

    Reply
  29. Dear Ravi,
    Thanks for your support , one more thing ..it seems to be a time mismatch in cacti time range..i have edited RTC to local timezone but still my graphs are not showing on current timings instead they are shown with a differnce of 5 hours. My timezone is Asia/Karachi

    Reply
  30. Dear Ravi,

    Hope you are fine. I have installed cacti as per your guide and I have then added Localhost in devices and template of load average, I am getting NAN value in graphs, should i wait for 24 hours to get it to poll ??

    I have disabled SElinux and run this command as you told (php /usr/share/cacti/poller.php), I hope for your usual support..

    Reply
    • @Aun,

      Yes, I am find, hope you too as well, yes you should wait at least 24 hours after running poller.php script to gather data and generate report using graphs..

      Reply
    • @Aun,

      It seems your Cacti installation was not successful, I suggest you to follow instructions carefully and step-by-step to avoid any issues..

      Reply
  31. Assalamu ‘alaikum wa rahmatullahi wa barakatuh​.

    Dear Ravi,

    I really appreciated your effort doing this. I have only one problem encountered which is [ERROR: FILE NOT FOUND] /usr/share/cacti/log/cacti.log.
    Would you please advise if I have to create manually the cacti.log file. Thank you very much in advance.

    Kind regards,
    Ali

    Reply
  32. Hi,
    I have been trying to install cacti monitoring tools for one of our internal server, unforfunalty im facing this issue while the installation process going on..

    Step: Install Cacti Tables to MySQL

    # /usr/share/doc/cacti-0.8.8b/cacti.sql

    [root@localhost ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/ cacti.sql
    -bash: /usr/share/doc/cacti-0.8.8b/: No such file or directory

    What could be the issue for the above step?

    Reply
    • @Cvaa,

      The error is self explanatory, the file cacti.sql doesn’t exist on the specified location, do you see the file under /usr/share/doc/cacti-0.8.8b/ directory?

      Reply
  33. I have cacti working as shown in this howto. I appreciate all your effort. It has been a learning experience…

    My issues are that the RRD background is shown and the SNMP is capturing stats.

    I do not get any actual graph data.

    If you can contact me offline or respond soonest. RHEL 7.2 with SELINUX permissive.

    I can send pics if you need them. Debugging shows snmp working and the DB talking…..

    tried 777 etc before and get the same results…thank in advance.

    Reply
    • @Chris,

      Thanks for appreciating our efforts in creating such easy article for you guys, regarding your issue, just give a day to pull the data from the server, or else you can manually run the poller.php script to update the graphs on the fly..

      # php /usr/share/cacti/poller.php
      
      Reply
    • @Max,

      No need to add anything, we are not using any fancy fonts for graphs, just skip this step and continue cacti installation.

      Reply
      • I’m done the installation. Now i’m facing problem to add device, I added my pc to devices but the status is unknown, no graph is generate and just showing broken image. Any solution?

        Reply
  34. HI Ravi,
    I re-install cacti from the scratch but now I have the same problem all guys have in http://192.168.8.102/cacti/install/index.php

    [NOT FOUND] Cacti Log File Path: The path to your Cacti log file.
    /usr/share/cacti/log/cacti.log
    [ERROR: FILE NOT FOUND].
    so please if there is any solution for this because i searched and i didn’t
    find the solution.

    thanks Ravi for your support

    Reply
  35. Dear,

    I follow everything from this guidelines but after I entering to browser by using http://myip/cacti/, there was error : FATAL: Cannot connect to MySQL server on ‘localhost’. Please make sure you have specified a valid MySQL database name in ‘include/config.php’

    What should I do? Your advise is much appreciated.

    Thank you.

    Reply
  36. Hello Ravi,

    Thank you for these useful information I really appreciate you. I really need using cacti in my work. so I followed all the steps correctly. however, when I entered my ip add http://ipadd/cacti it is showed nothing, I changed all the value to allow my ip but nothing is change. then after I followed some posts but I really lost and many issues raised. Now I am getting The requested URL cacti was not found on this server.

    Reply
  37. Re:
    [NOT FOUND] Cacti Log File Path: The path to your Cacti log file.
    /usr/share/cacti/log/cacti.log
    [ERROR: FILE NOT FOUND]

    This should resolve your issue.
    mkdir /var/log/cacti
    touch /var/log/cacti/cacti.log

    /usr/share/cacti/log is a symlink to /var/log/cacti which doesn’t exist

    Reply
    • @Samuel,

      May I know on which Linux distribution version you guys trying? so that I can setup locally on my VM to test it myself and will give you proper solution to this problem. I still think its something that Cacti was not installed properly or may be bug in the cacti release..

      Reply
  38. Hello, I just try again in a moment. But it still does not work. It seems that this is a problem of authorization on file .. What do you think?

    Reply
      • Nice try but it’s the second installation (clean VM). I followed your tutorial step by step. :(
        For informations : CentOS 6.8 and cacti version 0.8.8h from repo el6

        Reply
  39. Hello,

    Please could someone advise, I am not getting any graphs and it displays broken image.

    mysql> show databases;
    +——————–+
    | Database |
    +——————–+
    | information_schema |
    | cacti |
    | mysql |
    | test |
    +——————–+

    I am only using username root on mysql…

    vi /etc/cron.d/cacti

    */5 * * * * root /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

    vi /etc/cacti/db.php

    $database_type = “mysql”;
    $database_default = “cacti”;
    $database_hostname = “localhost”;
    $database_username = “root”;
    $database_password = “xxxxxxxx”;
    $database_port = “3306”;
    $database_ssl = false;

    cd /usr/share/cacti/

    ls -ls

    8 -rw-r–r– 1 root root 5860 May 9 16:20 about.php
    8 -rw-r–r– 1 root root 5348 May 9 16:20 auth_changepassword.php
    16 -rw-r–r– 1 root root 14690 May 9 16:20 auth_login.php
    12 -rw-r–r– 1 root root 10366 Jun 15 12:26 cacti.log
    20 -rw-r–r– 1 root root 20257 May 9 16:20 cdef.php
    0 lrwxrwxrwx 1 root root 18 Jun 14 12:24 cli -> /var/lib/cacti/cli
    28 -rwxr-xr-x 1 root root 26620 May 9 16:20 cmd.php
    8 -rw-r–r– 1 root root 6731 May 9 16:20 color.php
    24 -rw-r–r– 1 root root 23082 May 9 16:20 data_input.php
    36 -rw-r–r– 1 root root 33807 May 9 16:20 data_queries.php
    60 -rw-r–r– 1 root root 57419 May 9 16:20 data_sources.php
    32 -rw-r–r– 1 root root 31482 May 9 16:20 data_templates.php
    8 -rw-r–r– 1 root root 6108 May 9 16:20 gprint_presets.php
    4 -rw-r–r– 1 root root 3657 May 9 16:20 graph_image.php
    16 -rw-r–r– 1 root root 13060 May 9 16:20 graph.php
    12 -rw-r–r– 1 root root 9438 May 9 16:20 graph_settings.php
    20 -rw-r–r– 1 root root 17980 May 9 16:20 graphs_items.php
    40 -rw-r–r– 1 root root 39491 May 9 16:20 graphs_new.php
    60 -rw-r–r– 1 root root 57810 May 9 16:20 graphs.php
    12 -rw-r–r– 1 root root 10229 May 9 16:20 graph_templates_inputs.php
    20 -rw-r–r– 1 root root 18710 May 9 16:20 graph_templates_items.php
    28 -rw-r–r– 1 root root 25602 May 9 16:20 graph_templates.php
    44 -rw-r–r– 1 root root 42189 May 9 16:20 graph_view.php
    8 -rw-r–r– 1 root root 6480 May 9 16:20 graph_xport.php
    56 -rw-r–r– 1 root root 57011 May 9 16:20 host.php
    20 -rw-r–r– 1 root root 18756 May 9 16:20 host_templates.php
    4 drwxr-xr-x 2 root root 4096 Jun 14 12:24 images
    4 drwxr-xr-x 5 root root 4096 Jun 14 12:24 include
    4 -rw-r–r– 1 root root 2323 May 9 16:20 index.php
    4 drwxr-xr-x 2 root root 4096 Jun 14 12:24 install
    4 drwxr-xr-x 3 root root 4096 Jun 14 12:24 lib
    0 lrwxrwxrwx 1 root root 15 Jun 14 12:24 log -> /var/log/cacti/
    4 -rw-r–r– 1 root root 2838 May 9 16:20 logout.php
    4 drwxr-xr-x 2 root root 4096 Jun 14 12:24 plugins
    28 -rw-r–r– 1 root root 24716 May 9 16:20 plugins.php
    8 -rw-r–r– 1 root root 4310 May 9 16:20 poller_commands.php
    4 -rw-r–r– 1 root root 3374 May 9 16:20 poller_export.php
    20 -rwxr-xr-x 1 root root 18596 May 9 16:20 poller.php
    4 drwxr-xr-x 5 root root 4096 Jun 14 12:24 resource
    0 lrwxrwxrwx 1 root root 18 Jun 14 12:24 rra -> /var/lib/cacti/rra
    8 -rw-r–r– 1 root root 7475 May 9 16:20 rra.php
    0 lrwxrwxrwx 1 root root 22 Jun 14 12:24 scripts -> /var/lib/cacti/scripts
    12 -rw-r–r– 1 root root 10819 May 9 16:20 script_server.php
    8 -rw-r–r– 1 root root 6202 May 9 16:20 settings.php
    8 -rw-r–r– 1 root root 6227 May 9 16:20 templates_export.php
    8 -rw-r–r– 1 root root 5771 May 9 16:20 templates_import.php
    20 -rw-r–r– 1 root root 19673 May 9 16:20 tree.php
    44 -rw-r–r– 1 root root 42623 May 9 16:20 user_admin.php
    60 -rw-r–r– 1 root root 58501 May 9 16:20 utilities.php

    Reply
  40. Hi!
    Thanks for manual, just installed on Centos 6.8. When allowing 80 port in firewall better to use insertion (iptables -I), because in my case, rules was added after reject rule, and http service was unavailable

    Reply
  41. Hi, for installing plugins on Cacti, do i need to install anything else, do you have a manual for this version of Cacti 0.8.8g?

    Regards,

    Reply
    • @Pablo,

      No you don’t need to install anything else, other than Cacti and this article shows instructions for the cacti 0.8.8b version and I am sure there’s nothing much difference in Cacti 0.8.8g.

      Reply
    • @Volkan,

      Thanks for sharing the screenshot, I think it’s due to SELinux, could you disable it and check again?

      Reply
      • Thank you Ravi. I could not find a solution, and erased everything :D Now I’ll try to install again. (CentOS 6.8 64BIT)

        Reply
        • @Volkan,

          Good luck, and make sure to follow instructions carefully, if you stuck somewhere around while installing Cacti, do comment here, I will love to help you out..

          Reply
          • Thank you Ravi. I found my mistake.;
            #*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
            I delete the # sign :D
            Now it is running smoothly.
            I’ll try to build add-ons. (plugins)

          • @Volkan,

            I am glad that finally you found the mistake yourself and corrected, good luck for rest of things..

    • @Dennis,

      Please let me know what’s the group:owner permission of rrd files and directory? it should be apache:apache to function properly..

      Reply
      • [root@hpdcentos3 ~]# ls -l /usr/share | grep rrd
        drwxr-xr-x. 2 root root 6 Nov 21 2015 rrdtool
        [root@hpdcentos3 ~]# ls -l /usr/share/cacti/lib | grep rrd
        -rw-r–r–. 1 root root 91557 Feb 8 03:26 rrd.php

        Reply
        • @Dennis,

          It should be user/group apache, change the rrd directory and files ownership to apache recursively as shown

          # chown -R apache:apache path-to-rrd-directory
          
          Reply
          • @Dennis,

            After making changes, did you ran the poller.php file manually to collect data?

          • @Dennis,

            Here is the command to execute and populate cacti graphs with data..

            # /usr/bin/php /usr/share/cacti/poller.php
            
          • Hi Ravi,

            thanks, I’ve run the command you gave me. But my poller time seems a bit off, it seem to be pulling data from my servers at 8 hrs late. i check all timezones are set to +8 including the ones in php.ini file. Please advise.

          • Hi Ravie,

            Have setup NTP and configured according to yout tutorial. here is my system date.

            [root@hpdcentos3 local]# date
            Fri Jun 3 14:20:52 MYT 2016
            [root@hpdcentos3 local]# timedatectl
            Local time: Fri 2016-06-03 14:21:11 MYT
            Universal time: Fri 2016-06-03 06:21:11 UTC
            RTC time: Fri 2016-06-03 06:21:11
            Time zone: Asia/Kuala_Lumpur (MYT, +0800)
            NTP enabled: yes
            NTP synchronized: yes
            RTC in local TZ: no
            DST active: n/a
            [root@hpdcentos3 local]# date -R
            Fri, 03 Jun 2016 14:21:36 +0800
            [root@hpdcentos3 local]# date
            Fri Jun 3 14:21:40 MYT 2016
            [root@hpdcentos3 local]#

            but my graph is still 8hr late.
            did i miss anything??

          • @Dennis,

            Everything seems perfect, don’t know why such delay in generating graphs, let me dig into this and get back to you..

  42. After installing and doing all the steps of the guide I go to my cacti page and see just a blank page. Please your help I’m trying to install this server for 2 weeks now.

    Thanks

    Reply
    • @Gabriel,

      Sorry to hear that, may I know on which Linux distributions you’re trying? and you’ve followed cacti installation instructions correctly, could you give a try again? or else give me access to your server, let me setup for you for free.

      Reply
    • @Plaza,

      Please let me know on which Linux distributions you’re trying to install cacti? have you installed all required packages correctly?

      Reply
    • @Dennis,

      I think you should sync your system time with NTP to have proper graphs based on correct time, just check your system time is correct?

      Reply
      • hi Ravi,

        i read in another forum that suggest to install webmin. After i install & configured admin hardware time setting, my graph time is accurate.

        Reply
        • @Dennis,

          Thanks for sharing your findings, and I am glad that it finally showing correct graphs based on time…

          Reply
    • @Banu,

      There isn’t any one place, the Cacti tool gets installed all over the file-system, but the main configuration files resides under /etc/cacti directory..

      Reply
  43. In case of mysql is not on localhost you also need to enable network access for httpd (SElinux) else you will have errors like :
    FATAL: Cannot connect to MySQL server on ‘192.168.1.10’. Please make sure you have specified a valid MySQL database name in ‘include/config.php’

    setsebool -P httpd_can_network_connect=1

    Reply
  44. I have a problem same as Jhay, When I have got “FATAL: Cannot connect to MySQL server on ‘10.0.0.1’. Please make sure you have specified a valid MySQL database name in ‘include/config.php’”.

    My server is running on 10.0.0.1.
    I have created cacti database on mysql, and mysql is working fine. How I can solve?

    Reply
    • @Zaya,

      Please add the 10.0.0.1 IP address in db.php file under /etc/cacti/ directory like this:

      $database_hostname = "10.0.0.1";
      

      I hope it will solve your MySQL connectivity problem..

      Reply
  45. When I try to start mysql service I get the following error
    [vagrant@server1 /]$ sudo service mysqld start

    Redirecting to /bin/systemctl start mysqld.service
    Failed to start mysqld.service: Unit mysqld.service failed to load: No such file or directory.

    What file or directory is missing?

    Reply
  46. Dear Mr. Ravi Can you please provide some thorough tutorial on oracle DBA administration. from very first installation to common problems manage/troubleshoot oracle 11G/12C. I will be thankful to you.

    Reply
  47. Hi
    I have error on Cacti Installation which is “FATAL: Cannot connect to MySQL server on ‘localhost’. Please make sure you have specified a valid MySQL database name in ‘include/config.php'” pls help me to fix this

    Reply
  48. Hi,
    I have finished Cacti installations but i still can’t see graphs. For rrd files RRDTools says ‘ERROR: opening ‘/usr/share/cacti/rra/localhost_load_1min_5.rrd’: No such file or directory’.. I’ve tried changing the group ownership of rra directory to apache as mentioned above but it didn’t work.

    What I’m supposed to do next? Hope that there’s someone who can help here.
    Thanks!

    Reply
    • @Jolene,

      It seems that rrdtool tool didn’t generating those files, it could be the permission issues on /usr/share/cacti/ directory or try to rebuild Poller Cache from System Utilities (bottom of console).

      Reply
        • @Aleksei,

          Please check your SELinux settings and try to disable it and run the poller cron again and see the graphs are generating or not. Also check logs for any errors..

          Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.