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

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux course in 5 Days

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. 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. Follow Me: Twitter, Facebook and Google+

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

259 Responses

  1. Sandalia says:

    Thank you! Very clear and concise!

  2. Linux Student says:

    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

  3. sv-lex says:

    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

  4. Pablo says:

    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,

    • Ravi Saive says:

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

  5. Volkan says:

    Hi. I make what is missing?
    http://prntscr.com/ba6os9
    Images do not appear :/

    • Ravi Saive says:

      @Volkan,

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

      • Volkan says:

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

        • Ravi Saive says:

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

          • Volkan says:

            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)

          • Ravi Saive says:

            @Volkan,

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

  6. Dennis says:

    HI Ravi,

    Just want to know why my graph all show “rrd file does not exist”?

    • Ravi Saive says:

      @Dennis,

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

      • Dennis says:

        [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

        • Ravi Saive says:

          @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
          
          • Dennis says:

            now my graph doesnt show any CPU utilization.

          • Ravi Saive says:

            @Dennis,

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

          • Dennis says:

            Hi Ravi, how to run the poller.php?

          • Ravi Saive says:

            @Dennis,

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

            # /usr/bin/php /usr/share/cacti/poller.php
            
          • Dennis says:

            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.

          • Ravi Saive says:

            @Dennis,

            Better sync your server time with NTP, here is the guide on how to do it http://www.tecmint.com/install-ntp-server-in-centos/

          • Dennis says:

            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??

          • Ravi Saive says:

            @Dennis,

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

  7. Nick says:

    what is the cacti user password?

  8. Gabriel says:

    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

    • Ravi Saive says:

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

  9. Plaza says:

    I followed all the steps and all I see is a blank page, please your help with this.

    • Ravi Saive says:

      @Plaza,

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

  10. trongtrong says:

    hi, t have error “SNMP ERROR” when t try “add new device”, pls help me fix this

Got something to say? Join the discussion.

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

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's