Monitor Apache server performance using Cacti in CentOS

Source: Internet
Author: User
Tags rrd rrdtool

Cacti is an excellent monitoring tool that intuitively displays the status of Monitored Objects through templates or custom templates. By importing the apache_status template, Cacti can monitor the performance of Apache servers.

1. Configure apache

1. Enable server status Details

Edit the apache main configuration file httpd. conf and remove the comments before the following statement: vim/etc/httpd/conf/httpd. conf

ExtendedStatus On

2. Configure Apache Server Status Permissions

Edit the apache main configuration file httpd. conf and remove the comments before the following statement: vim/etc/httpd/conf/httpd. conf

<Location/server-status>
SetHandler server-status
Order deny, allow
Deny from all
Allow from localhost # Here localhost is the Cacti monitoring host
</Location>

3. Save and restart the modification.

Apachectl-k graceful

Note: If the apache server is compiled and installed through the source code, the corresponding server_status module must be added during compilation.

2. Import Template

Download the required template and PHP file, stamp the http://forums.cacti.net/download/file.php? Id = 18576 & sid = 8d429b69af5be45179d928e1303f2077

After decompression, upload ss_apache_stats.php to the/var/www/cacti/scripts directory:

Cp ss_apache_stats.php/var/www/html/cacti/scripts/

Import the cacti_host_template_webserver _-_ apache. xml template on the Cacti Web interface:

Click Import/Export-> Import Templates to upload the template.

3. Add a device and create a chart

Log on to the Cacti Web page, add the monitored apache server device, and create the corresponding chart:

Devices-> Add-> WebServer-Apache template-> Create New Graphs, Add the required chart. Wait for a while and the image will be displayed. The figure is as follows:

Note: after creating the image Apache_server-Apache Stats-F-Thread Details (%), the following figure shows how to enable the debugging mode and check that rrdtool reports an error:

RRDTool Says:
ERROR: Expected some arguments after 'comment :'

This is a bug in Cacti 0.8.8b. Solution: add the attachment patch to the rrd. php file.

Cd/var/www/html/cacti/lib

Patch-R rrd. php <rrd.php_patch.txt

-- Yunxiang cloud stop

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.