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

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
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

194 Responses

  1. 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:

      @Thomas,
      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:

          @Thomas,
          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
            owners.

            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
            Bye
            [root@metamon01s ~]# rpm -ql cacti | grep cacti.sql
            /usr/share/doc/cacti-0.8.8b/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
            Bye
            [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 = “metamon01s.mydomainname.com”;
            $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:

            @Thomas,
            Thanks for the detailed information, still you see blank page? Can I have a look into the server? send me details to admin@tecmint.com

    • 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.

  2. 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.

  3. BuffPuff says:

    Thanks a bunch, this was very helpful.

  4. Sara kiran says:

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

  5. 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
    UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
    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
    http://www.computerhope.com/unix/uifconfi.htm, 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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Join Over 80000+ Linux Users
  1. 52882
  2. 2763
  3. 18,639

Enter your email to get latest Linux Howto's