Install Cacti (Network Monitoring) on RHEL/CentOS 7.x/6.x/5.x and Fedora 21-12

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Support TecMint: Did you find this tutorial helpful?. Please help to keep it alive by donating. Every cent counts! - Donate Now

Ravi Saive

Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

201 Responses

  1. Bob the Builder says:

    Hi, on the step where you find the location of Cacti.sql and then need to use the cacti user password, when/where was the step to create the cacti user account and assign a password?

    Very newb to linux, and using this to help teach myself some setups.

    • Ravi Saive says:


      Run the following command to locate the location of Cacti.sql file.

      # rpm -ql cacti | grep cacti.sql

      Under “Create MySQL Cacti Database” section, you will find instructions to create Cacti database, user and password..

  2. mahyar says:

    Would you please help me, i want monitor bind 9.8.2 statistic by cacti which has been installed according to your professional document, please investigate a way, i couldn’t find it

  3. Rohan panchal says:


    after successful installation of cacti, i get server not found error as per following.

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

    Apache/2.2.15 (CentOS) Server at Port 80

  4. Nena says:


    I have some problems after installing cacti. I am new in the linux and it is very difficult to resolve them.
    Fist when I go to Cacti console > settings I received a message error “ It may be down for maintenance or configured incorrectly ”
    The second problem is weathermap plugin wasn’t created tables in cacti databes, I created them manualy. Weathermap editor is successfully completed and it is work, but when I created something on new map It doesn’t appear as map in Network Weathermaps.
    Also I receive that message error when try to use realtime plugin “The Image Cache Directory directory does not exist. Please first create it and set permissions and then attempt to open another realtime graph. ”

    There are problems also with syslog and discover plugins but they are not important for me.

    Could you please help me as tell me what is needed to do. I really need to have this work.

  5. Chris G says:

    Many thanks, great article!! works like a charm.. :)

  6. Thomas says:

    Hi there, I followed your guide to the letter, but after the install/setting up cron (and even rebooting the server), only thing I get is a blank webpage.
    How can I find out why?

    • Ravi Saive says:

      Have you installed PHP and php modules correctly as described in the article?

      • Thomas says:

        Yes I did. With the exact command as stated above.
        Just for sake of argument, I’ve done it again (yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli and yum install php-snmp), but it says this so it should be good.
        Package php-mysql-5.3.3-46.el6_6.x86_64 already installed and latest version
        Package 1:php-pear-1.9.4-4.el6.noarch already installed and latest version
        Package php-common-5.3.3-46.el6_6.x86_64 already installed and latest version
        Package php-gd-5.3.3-46.el6_6.x86_64 already installed and latest version
        Package php-devel-5.3.3-46.el6_6.x86_64 already installed and latest version
        Package php-5.3.3-46.el6_6.x86_64 already installed and latest version
        Package php-mbstring-5.3.3-46.el6_6.x86_64 already installed and latest version
        Package php-cli-5.3.3-46.el6_6.x86_64 already installed and latest version
        Nothing to do

        Package php-snmp-5.3.3-46.el6_6.x86_64 already installed and latest version
        Nothing to do

        • Ravi Saive says:

          I suggest you to check following things:

          1. Please cross check that all the required packages are installed for cacti
          2. Please check cacti database is created and imported cacti tables into cacti database
          3. In db.php file add the correct MySQL settings
          4. Check Apache configuration and make sure to allow cacti from your IP address

          After checking all the above things, try to browse again. If you still not able to see the cacti page, just send me your server details I will setup for you…

          • Thomas says:

            Hi Ravi,
            Here you go:
            [root@metamon01s ~]# mysql -u root -p
            Enter password:
            Welcome to the MySQL monitor. Commands end with ; or \g.
            Your MySQL connection id is 2
            Server version: 5.1.73 Source distribution

            Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

            Oracle is a registered trademark of Oracle Corporation and/or its
            affiliates. Other names may be trademarks of their respective

            Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

            mysql> show databases;
            | Database |
            | information_schema |
            | cacti |
            | mysql |
            | test |
            4 rows in set (0.11 sec)

            mysql> quit
            [root@metamon01s ~]# rpm -ql cacti | grep cacti.sql
            [root@metamon01s ~]# mysql -u cacti -p cacti show tables from cacti;
            | Tables_in_cacti |
            | cdef |
            | cdef_items |
            | colors |
            | data_input |
            | data_input_data |
            | data_input_fields |
            | data_local |
            | data_template |
            | data_template_data |
            | data_template_data_rra |
            | data_template_rrd |
            | graph_local |
            | graph_template_input |
            | graph_template_input_defs |
            | graph_templates |
            | graph_templates_gprint |
            | graph_templates_graph |
            | graph_templates_item |
            | graph_tree |
            | graph_tree_items |
            | host |
            | host_graph |
            | host_snmp_cache |
            | host_snmp_query |
            | host_template |
            | host_template_graph |
            | host_template_snmp_query |
            | plugin_config |
            | plugin_db_changes |
            | plugin_hooks |
            | plugin_realms |
            | poller |
            | poller_command |
            | poller_item |
            | poller_output |
            | poller_reindex |
            | poller_time |
            | rra |
            | rra_cf |
            | settings |
            | settings_graphs |
            | settings_tree |
            | snmp_query |
            | snmp_query_graph |
            | snmp_query_graph_rrd |
            | snmp_query_graph_rrd_sv |
            | snmp_query_graph_sv |
            | user_auth |
            | user_auth_perms |
            | user_auth_realm |
            | user_log |
            | version |
            52 rows in set (0.02 sec)

            mysql> quit
            [root@metamon01s ~]# vi /etc/cacti/db.php
            /* make sure these values refect your actual database/host/user/password */
            $database_type = “mysql”;
            $database_default = “cacti”;
            $database_hostname = “”;
            $database_username = “cacti”;
            $database_password = “%my db cacti user password%”;
            $database_port = “3306”;
            $database_ssl = false;

            [root@metamon01s ~]# vi /etc/httpd/conf.d/cacti.conf
            # On httpd 2.4, change “Require host localhost” to “Require all granted”.
            # On httpd 2.2, change “Allow from localhost” to “Allow from all”.

            Alias /cacti /usr/share/cacti

            # httpd 2.4
            Require all granted

            # httpd 2.2
            Order deny,allow
            Deny from none
            Allow from all

            # mod_security overrides.

            [root@metamon01s ~]#

            Thanks for the help so far.

          • Ravi Saive says:

            Thanks for the detailed information, still you see blank page? Can I have a look into the server? send me details to

    • Thomas says:

      I fixed this issue:
      TL;DR firewall rule config error.

      The firewall commands to add -A INPUT -p udp -m state –state NEW -m udp –dport 80 -j ACCEPT and -A INPUT -p tcp -m state –state NEW -m tcp –dport 80 -j ACCEPT are added behind the -A INPUT -j REJECT –reject-with icmp-host-prohibited rule, so it blocks traffic on port 80 before allowing it, regardless of apache…

      Figured this out by spinning up a second vm -with a gui- and checking if the localhost could access it (which it could), and troubleshooting from there.

  7. Vijay says:

    Is it possible to get data related to mysql database in cacti.

    Like number of queries executed for second.

    Number of reads, no of writes etc.

  8. BuffPuff says:

    Thanks a bunch, this was very helpful.

  9. Sara kiran says:

    Sir if you know any other way kindly guide me.Thank you.

  10. Sara kiran says:

    Hope you must be fine by grace of God. I am facing a problem in my thesis which is about to change the link data rate depending upon the buffer occupancy i-e if the buffer space is filled above threshold then increase the link data rate and if the buffer is occupied below threshold then reduce the link data rate. Now the problem exists in determining the buffer space occupied. For this I am using” ifconfig” and “netstat”.
    For ifconfig the output for switch AS-1 eth1 is as follows (by using netstat I was getting the same output):
    AS-1-eth1 Link encap:Ethernet HWaddr 7a:81:df:f1:29:74
    inet6 addr: fe80::7881:dfff:fef1:2974/64 Scope: Link
    RX packets: 88 errors: 0 dropped: 0 overruns: 0 frame: 0
    TX packets: 57 errors: 0 dropped: 0 overruns: 0 carrier: 0
    Collisions: 0 txqueuelen: 1000
    RX bytes: 12266 (12.2 KB) TX bytes: 9052 (9.0 KB)
    Now I am thinking, packets in queue= RX packets-TX packets=88-57=31packets (31 packets are in the buffer). Am I thinking in the right direction?
    For “ifconfig” kindly check the following link, Kindly just go through the overview, I know your time is really precious and sorry to bother you, kindly reply me as soon as possible. Thanks in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *

Join Over 95000+ Linux Users
  1. 66,682
  2. 3,836
  3. 31,647

Enter your email to get latest Linux Howto's