Installing the open-source system monitoring tool cacti in centos 5.5

Source: Internet
Author: User
Tags rrdtool snmpget snmpwalk

Cacti is an open-source network monitoring tool that monitors the status and load of hosts, it can be used to monitor the running status of servers such as Apache and MySQL.

Cacti Official Website: http://www.cacti.net/

Cacti must run in PHP, MySQL, and Apache environments. PHP is its data collection script execution environment. MySQL is used to save data. Apache is used to provide its front-end configuration and monitoring interface. Some components are required during installation, such as PHP-SNMP, PHP-XML, PHP-LDAP, and rrdtool. These software packages may also be installed when installing the lamp environment. Even if it is not installed, some dependent components will be installed when you use the yum command.

Remember to set a password for the root account of MySQL to protect the database security. You can use the following command to change the root password:
Mysqladmin-user = root password somepassword

Cacti installation Configuration

1. Use the following command to install cacti. This will automatically install the required components.
# Yum install cacti

The installed version is the cacti-0.8.7g.
The user cacti and user group cacti will also be created.

Note: My cacti is installed from the yum installation source of rpmforge. You may need to configure this installation source first. For information on configuring the rpmforge installation source, visit an article translated by the blogger mesh in http://blog.why100000.com.

2. Create a MySQL database cacti
# Mysqladmin-uroot-pxxxxxx create cacti

Or:
# Mysql-uroot-P
Enter the password to go To the MySQL management interface, and then run the create database Command:
> Create Database cacti;

3. import data from the default cacti Database

If you use the yum default installation, the script for creating data defaults to/var/www/cacti-0.8.7g/cacti. SQL.
# Cd/var/www/cacti-0.8.7g/

# Mysql-uroot-pxxxxxx cacti <cacti. SQL

4. Edit the cacti configuration and set the data connection.

# Gedit/var/www/cacti-0.8.7g/include/config. php

Here is the database type, user name, and password used for cacti connection.

/* 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 = "cactiuser ";
$ Database_port = "3306 ";
/* Default session name-session name must contain Alpha characters */
# $ Cacti_session_name = "cacti ";

The above configuration is set according to your own environment.

5. Configure the automatic job time to edit crontab.

[Root @ tigertall log] # crontab-e

Add the following content,

*/5 * PHP/var/www/cacti/poller. php>/dev/null 2> & 1

The above configuration means to execute the PHP script poller. php every five minutes to count and save the data.

6. Configure the Apache Virtual Path

Add the following at the end of the/etc/httpd/CONF/httpd. conf file:

Alias/cacti/var/www/cacti/
<Directory "/var/www/cacti">
Options indexes includes followsymlinks
AllowOverride none
Allow from all
Order allow, deny
</Directory>

7. log on to the server

Log on to http: // localhost/cacti in the browser on the machine where cacti is installed.

When you run it for the first time, the install page is displayed, and the cacti Installation Guide is displayed.
Click the next link in the lower-right corner to go to the next page.

Page displayed: Please select the type of installation
Select New install and click Next in the lower-right corner.

Then go to the parameter configuration page:

Make sure all of these values are correct before continuing.

[Found] rrdtool binary path: the path to the rrdtool binary.
/Usr/bin/rrdtool
[OK: file found]

[Found] PHP binary path: the path to your PHP binary file (may require a PHP recompile to get this file ).
/Usr/bin/PHP
[OK: file found]

[Found] snmpwalk binary path: the path to your snmpwalk binary.
/Usr/bin/snmpwalk
[OK: file found]

[Found] snmpget binary path: the path to your snmpget binary.
/Usr/bin/snmpget
[OK: file found]

[Found] snmpbulkwalk binary path: the path to your snmpbulkwalk binary.
/Usr/bin/snmpbulkwalk
[OK: file found]

[Found] snmpgetnext binary path: the path to your snmpgetnext binary.
/Usr/bin/snmpgetnext
[OK: file found]

[Found] cacti log file path: the path to your cacti log file.
/Var/www/cacti/log/cacti. Log
[OK: file found]

SNMP utility version: the type of SNMP you have installed. required if you are using SNMP v2c or don't have embedded SNMP support in PHP.
[NET-SNMP 5.x]

Rrdtool utility version: the version of rrdtool that you have installed.
Rrdtool 1.4.x

Note: Once you click "finish", all of your settings will be saved and your database will be upgraded if this is an upgrade. you can change any of the settings on this screen at a later time by going to "cacti Settings" from within cacti.

Click "finish" to complete the installation. The logon page is displayed.

8. The initial user and password are both Admin. Enter them and log on. Then immediately ask to change the new password. After the change, the cacti management and detection interface will be displayed.

At initial logon, the username and password are admin. After logon, you must change the password immediately.

After saving the new password, the cacti management and detection interface is displayed.

You can also run a browser to log on to a machine in the same network segment.

Author: Zhang Qing (mesh) Xi'an PHP Education and Training Center 2010-9-3
From mesh horizon: http://blog.why100000.com
Author Weibo: http://t.qq.com/zhangking
Why 100,000 computer learning networks: http://www.why100000.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.