RHEL7: How to install a Cacti service.

Share this link

Presentation of Cacti

Cacti is a monitoring application based on the rrdtool.
With Cacti, you can monitor one machine (CPU, memory, IO) or a group of machines.
Each machine under supervision requires the installation of the SNMP service.

Prerequisites

To monitor one or a group of machines, you need to install several dependencies:

Installation Procedure

Install the PHP packages:

# yum install -y php php-mysql php-snmp

Then, install the EPEL7 remote repository.

Finally, install the Cacti package:

# yum install -y cacti

Create the Cacti database:

# mysql -u root -p
Enter password: password
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 5.5.35-MariaDB MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database cacti;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on cacti.* to cacti@localhost identified by 'password';
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

Create the Cacti tables:

# rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.8b/cacti.sql
# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql

Edit the file called /etc/cacti/db.php and set the database name, user name and password:

# vi /etc/cacti/db.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "password";
$database_port = "3306";
$database_ssl = false;

Edit the /etc/php.ini file and assign the proper timezone to the date.timezone variable like for example:

date.timezone = "Europe/Berlin"

Edit the file called /etc/httpd/conf.d/cacti.conf and replace Require host localhost with Require all granted in the file.
This configuration allows every host to connect to the Cacti service: restrict this permission as necessary.

Restart the HTTP service:

# apachectl restart

Edit the file /etc/cron.d/cacti and uncomment the line.
Start a browser at http://your-ip/cacti. Select “Next >>“, then “New Install“/”Next >>” and “Finish“.
Finally, enter admin/admin as login/password and press “Login“.
You will have to type a new password.

At this point, you’ve got an operational Cacti service.

Additional Resources

If you are searching for plugins, Percona offers good free Cacti plugins for Apache, MySQL, Nginx, Memcached, etc.

Source: Inspired by www.tecmint.com.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Leave a Reply

RHCSA7: Task of the day

Allowed time: 8 minutes.
Find all files bigger than 100MB and write their names into the /root/results.txt file.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a default secure MariaDB database called maria with a user named muser with all privileges.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...

Archives