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


libstdc++.so.5 is needed by xxx

Trying to install the IBM JDK 64bit I came across the following error:

libstdc++.so.5 is needed by ibm-java2-x86_64-sdk-5.0-8a.0.x86_64

It turns out that yum has a neat feature to show what package provides a given component:

yum whatprovides libstdc++.so.5

gave the answer, and

yum install compat-libstdc++-33.i386

took care of installingthe missing package.


Public key for xxx.rpm is not installed

After an upgrade to CentOS 5 / RHEL 5 we got the following error:

Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
Public key for openldap-2.3.27-8.el5_2.4.x86_64.rpm is not installed

It turns out that the key needs to be loaded and yum has not tried to load the key properly. The following manual key loading solved the issue:

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5