Skip to content

Cacti on Fedora 10 – Part 1

— Cacti on Fedora 10 —

One thing I’ve noticed about the Ubuntu community, is they have some really great
guides for configuring server packages. However, I like Fedora…….I guess it’s the hat or something.
While there is a Fedora Doc site, it’s lacking guides for most things that are in
the Fedora repos.

I’m planning on joining the Fedora team and submitting such docs in the future. I figured
this would be a great place to test some of my guide ideas.

I’m using a cross between the docs at the cacti site and my own trial and errors.
This will be a multi-part HOWTO. The first write up, will walk you through everything
needed to get cacti up and running on Fedora 10 from scratch.

—————–

0. I’m assuming you have Fedora 10 already installed and ready to go. 🙂

—————–

1. Installing Cacti and all the requirements: (mysql server, apache, etc.)
# You can simply copy and paste. If you’re not in the sudoers file yet, either add yourself or switch to root.

sudo yum install -y mysql mysql-server httpd mod_ssl php php-snmp php-mysql net-snmp net-snmp-utils rrdtool cacti

# Almost everything will be done for you (so no need to follow the Cacti Manual 100%)
# However, it’s good to read and understand where all the core files are.
# So either visit the cacti site or check the docs under /usr/share/doc/cacti-0.8.7b/*

—————–

2. Setup the MySQL server:

# If you’ve just installed the MySQL server, you’ll need to configure the root account & password.
# If you already have a mysql server installed and configured simply skip the “mysql_secure_installation”.

sudo service mysqld start
sudo /usr/bin/mysql_secure_installation (answer all questions as needed/desired)
mysqladmin -u root -p create cacti
sudo mysql -p cacti < /usr/share/doc/cacti-0.8.7b/cacti.sql

# Open the mysql database and configure the cacti user privs/password etc.

mysql -u root -p mysql
mysql>GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'SOME-PASSWORD';
mysql>flush privileges;
mysql>exit

——————

3. Configure the cacti database configuration settings:.

Backup the default config.php (/usr/share/cacti/include/config.php), which actually links to “/etc/cacti/db.php”
Then edit “/etc/cacti/db.php” and specify the database type, name, host, user and password for your Cacti configuration.

sudo vi /etc/cacti/db.php

$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”; <—- created via the cacti.sql script
$database_password = “cacti”; <—- change this to the above ‘SOME-PASSWORD’

—————–

4. Configure Cron to run the poller script:

# Make sure your /etc/cron.d/cacti looks like so. (you’ll need to remove the #)

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

—————–

5. Start up mysql and apache:

# Start/Restart your MySQL and Apache servers.

sudo service mysqld start
sudo service httpd start

#Point your web browser to:

http://localhost/cacti/ or https://localhost/cacti/

Continue with the installation via the web browser, when you get to the page that locates “rrdtool” etc.
make sure everything is “FOUND” and has the correct path.
IMPORTANT – at the bottom of this same screen change the default “RRDTool Utility version” from 1.x to 1.2.x.
Click “Finish”

Log in the with a username/password of admin. You will be required to change this password immediately.

You can now start creating new devices per the Cacti users guides or poke around and figure it out.

—————–

6. Alter the cacti.conf file for access:

Note: Once you’ve got everything set up the way you want and are ready to access your new Cacti install from
else where, you’ll need edit the /etc/httpd/conf.d/cacti.conf file.
Simply alter the Allow statement as needed.

#
# Cacti: An rrd based graphing tool
#
Alias /cacti /usr/share/cacti
Order Deny,Allow
Deny from all
Allow from 127.0.0.1

—————–

7. Make sure mysqld and httpd are running on boot. 😉

sudo chkconfig httpd on
sudo chkconfig mysqld on

—————–

In part 2, I’ll walk you through examples of configuring various devices.

Take care.

DB

Published inLinuxNetwork

14 Comments

  1. john john

    best instruction set i evah saw – has saved me hours – truly wonderful thankyou so much

  2. Karl Lewis Karl Lewis

    Me too, at this point, but yes… this guide is perfect. It’s concise, accurate and even though we’ve moved to Fedora 12, it still works fine!

    KWL

  3. RAbel RAbel

    I did everything exactly as you said 3 times on 3 different fresh installs, and every time I get the following message, and I have no idea how to fix it.

    Missing file: /usr/share/cacti/lib/adodb/drivers/adodb-“mysql”.inc.php
    ADONewConnection: Unable to load database driver ”

  4. RAbel RAbel

    Nevermind, it’s because I copied and pasted instead of typing in out.

  5. WWWillem WWWillem

    Used this HOWTO on Fedora 12 (fresh install in a VM on my Mac) and it worked flawless!!

  6. cjc cjc

    I had the same problem and resolved it by changing this:

    Alias /cacti /usr/share/cacti
    Order Deny,Allow
    Deny from all
    Allow from localhost

    then https://localhost/cacti/

    *note the https and local host

    Hope that helps

Leave a Reply

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