Installing Cacti from rpm on RHEL 5.8

Alongside Centreon, it might be interesting to have additional monitoring and capacity planning tools. Cacti is a frontend to RDDTool and can gather and store state information from any element of your IT infrastructure. Information are located in a MySQL database and in RDD databases as well. RHEL 5.8 comes up with a rpm package for Cacti.

Here are the prerequisites for Cacti. Please install these dependencies as an initial step :

root@localhost:~# rpm -qa |grep -Ei ‘(httpd|mysql-server|php-mysql|php-gd|php-snmp)’
httpd-2.2.3-65.el5_8
mysql-server-5.0.95-1.el5_7.1
php-mysql-5.1.6-39.el5_8
php-gd-5.1.6-39.el5_8
php-snmp-5.1.6-39.el5_8

If the packages above are not present, please install them.  Then, create the MySQL database cacti and an user cactiuser with the appropriate privileges.

root@localhost:~#mysql -u root -p ‘create database cacti’

mysql> CREATE USER cactiuser

mysql> GRANT ALL ON cacti.* to cactiuser@localhost IDENTIFIED BY ‘your_password’;

mysql> FLUSH privileges;

mysql> quit;

Now populate the new database cacti with its structure. Import the sql database creation file as follows :

fool@localhost:~$ mysql -u root -p cacti < /usr/share/doc/cacti-0.8.8a/cacti.sql

Add the right credentials to access cacti database in this file :

root@localhost:~# cat /etc/cacti/db.php

<?php
/*
+————————————————————————-+
| Copyright (C) 2004-2012 The Cacti Group                                 |
|                                                                         |
| This program is free software; you can redistribute it and/or           |
| modify it under the terms of the GNU General Public License             |
| as published by the Free Software Foundation; either version 2          |
| of the License, or (at your option) any later version.                  |
|                                                                         |
| This program is distributed in the hope that it will be useful,         |
| but WITHOUT ANY WARRANTY; without even the implied warranty of          |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
| GNU General Public License for more details.                            |
+————————————————————————-+
| Cacti: The Complete RRDTool-based Graphing Solution                     |
+————————————————————————-+
| This code is designed, written, and maintained by the Cacti Group. See  |
| about.php and/or the AUTHORS file for specific developer information.   |
+————————————————————————-+
| http://www.cacti.net/                                                   |
+————————————————————————-+
*/

/* make sure these values refect your actual database/host/user/password */
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
//$database_password = “your_password”;
$database_password = “cacti”;
$database_port = “3306”;
$database_ssl = false;

/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
//$url_path = “/cacti/”;

/* Default session name – Session name must contain alpha characters */
//$cacti_session_name = “Cacti”;

?>

Once done, modify Apache configuration file to make cacti available to browsers. In the first lines of /etc/httpd/conf.d/cacti.conf, make sure you have these details :

Alias /cacti    /usr/share/cacti

<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require host localhost
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
#               Deny from all
#               Allow from localhost
Allow from all
</IfModule>
</Directory>

I replaced Allow from localhost by Allow from all. You can replace it if you want to limit access to http://localhost/cacti for security reasons.

After Apache conf file being modified, reload its configuration :

root@localhost:~#service httpd configtest && service httpd reload

The last steps of Cacti configuration is made through a web interface. Point your browser to the following url : http://localhost/cacti and just click on the next button at the bottom right hand corner to complete the installation.


Time now to log in. The default credentials are admin/admin. You will asked to change admin’s password :

And finally :

 

 

 

Advertisements

One thought on “Installing Cacti from rpm on RHEL 5.8

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s