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