Cacti Install on RHEL 5 or CentOS 5

Introduction

Cacti is a great tool to graph performance of the various hardware components of a network. With the use of the yum repository manager, it is very simple to install on Red Hat Enterprise Linux 5 or CentOS 5.

Install steps

  • First make sure that you have the dag repository configured in yum. Edit or create the file /etc/yum.repos.d/dag.repo:
    [dag]
    name=Dag RPM Repository for Red Hat Enterprise Linux
    baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
    gpgcheck=0
    enabled=1
    protect=0
  • Now install the required packages:
    sudo yum install net-snmp mysql mysql-server cacti
  • Edit the /etc/httpd/conf.d/cacti.conf file to allow access to cacti as needed.
  • Make sure Apache and MySQL are started and set to start automatically:
    sudo service mysqld start
    sudo service httpd start
    sudo chkconfig –level 345 mysqld on
    sudo chkconfig –level 345 httpd on
  • Set up the cacti database in MySQL:
    sudo mysqladmin –user=root create cacti
    cd /var/www/cacti
    sudo mysql cacti < cacti.sql sudo mysql --user=root mysql mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘cactiuser’;
    mysql> SET PASSWORD FOR cactiuser = PASSWORD('my_super_secret_cacti_password');
    mysql> flush privileges;
    mysql> exit
    sudo mysqladmin –user=root password "my_super_secret_root_password"
  • Setup the cacti poll schedule in /etc/crontab:
    */5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1
  • Run the cacti installer in the browser:
    http://your.server.com/cacti/index.php
    provide the user and password for the database, you can accept all defaults and just click next
  • That is it, you are good to go.

References

Installing Cacti on CentOS with yum


Setting up shared VMWare Fusion host folders on CentOS and RHEL guest

Problem

How to view folders from the Mac that hosts the VMWare Fusion guest operating system CentOS or Red Hat Linux?

Solution

  • First, make sure that the VMWare Tools are installed. That always helps.
  • Next, in the WMWare configuration menu of the guest, set up the desired shared folders. There might be already a default shared folder pointing to the user’s home directory.
  • Next, in the guest OS, ls -ld /mnt/hgfs will display the available shared folders.

References

[CentOS-virt] CentOS 5.1 guide for VMware Fusion


Fixing Yum dependency problems on RedHat Linux and CentOS

Yum update fails

I see the question of failed dependencies come up on forums quite a bit. Users post errors like:

Missing Dependency: bind-utils = 9.3.4-10.P1.el5_3.1 is needed bind-sdb-9.3.4-10.P1.el5_3.1

or

ImageMagick-perl-6.2.8.0-4.el5_1.1.x86_64 from installed has depsolving problems
--> Missing Dependency: /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi is needed by package ImageMagick-perl-6.2.8.0-4.el5_1.1.x86_64

or

httpd-2.2.3-22.el5.centos.2.x86_64 from updates has depsolving problems
--> Missing Dependency: /usr/share/magic.mime is needed by package httpd-2.2.3-22.el5.centos.2.x86_64 (updates)

In all these cases, the solution is to clean yum:
yum clean all

References