Upload
artica-st
View
156
Download
1
Embed Size (px)
DESCRIPTION
This is an enterprise plugin to get information status on Apache by using the status module. It uses perl and wget to grab the information. For more information visit the following web page: http://pandorafms.com/index.php?sec=Library&sec2=repository&lng=en&action=view_PUI&id_PUI=270
Citation preview
Pandora FMSAdministrator Manual
Apache WebServer Monitoring
Administrator Manual Apache WebServer Monitoring
© Artica Soluciones Tecnológicas 2005-2012
Index1Changelog...........................................................................................................................................32Introduction........................................................................................................................................43Compatibility Matrix..........................................................................................................................54Documentation provided by the requesting area................................................................................65Modules of Apache Webserver available...........................................................................................76Monitoring Apache Webserver..........................................................................................................8
6.1.Monitoring via plugins and modules.........................................................................................86.1.1.Plugin Agent (local method) .............................................................................................9
1 CHANGELOG
Date Author Change Version
09/05/11 Tomas First Version v1r1
27/11/12 Mario_P Change code v1r2
02/07/13 Mario_P Change code v1r3
22/08/13 Axel Change code v1r4
Page 3
2 INTRODUCTION
This plugin allow you to monitor the Apache Web server status using mod_status.
3 COMPATIBILITY MATRIX
Page 4
Was tested in these systems • Apache 1.3.x• Apache 2.x
It should work in these systems• Apache 1.3.x• Apache 2.x
4 DOCUMENTATION PROVIDED BY THE REQUESTING AREA
Page 5
These parameters must be provided by the area which request the monitoring services:
• username: username to authenticate in Apache
• password: password to authenticate in Apache
• command: use wget or curl command.
• IP address: IP of Apache server to monitor
5 MODULES OF APACHE WEBSERVER AVAILABLE
Page 6
The parameters available to monitor are:
• ApacheTotalTraffic
• ApacheTotalAcceses
• ApacheServerUptime
• ApacheRestartTime
• ApacheIdleWorkers
• ApacheCurrentRequests
• Apache Request/Sec
• Apache CPU Load
• Apache (B/kB/MB)/Sec
• Apache (B/kB/MB)/Request
6 MONITORING APACHE WEBSERVER
6.1. Monitoring via plugins and modules
Page 7
Once we have installed and configured both Pandora and Apache servers, we're going to explain how to obtain info about the server status.
There are different ways to achieve this goal, but the easiest and the one on which we're going to focus is using plugin agents to include modules designed to monitor this information in the Pandora server, offered by Apache server-status webpage. We can check this page if we have installed the mod_status module in our Apache server.
6.1.1. Plugin Agent (local method) Let's suppose we have installed Pandora and Apache servers on different machines, with all the monitoring systems installed. (Pandora Agent, mod_status)
To perfectly configure the system in order to monitor Apache with mod_status in Pandora, we've got to find in the Apache server the files httpd.conf (for Apache 1.3.x) apache2.conf (for Apache2.x) or status.conf (some Apache 2 versions and Turnkeys)
These files can be respectively found in:
Page 8
/etc/apache/
/etc/apache2/
/etc/apache2/mods-enabled
For Apache 1.3.x, we need to make sure the following entry exists in /etc/apache/modules.conf:
LoadModule status_module /usr/lib/apache/1.3/mod_status.so
For Apache 2.x, we need to obtain mod_info. We can make sure we have it by writing in the terminal the following:
a2enmod info
Once we have located the corresponding config file, include or uncomment the following:
Note: is Apache 2.x is recommended to verify if this paragraph is inside apache2.conf or status.conf
ExtendedStatus On<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from <Pandora-Server-IP> Allow from <Machine-Browser-Test-IP></Location>
With everything configured, only a restart or reload of the Apache server is needed to continue.
We need a script to gather the values we want to monitor from the HTML file which contains the Apache Server Status.
We've used an Apache Tomcat Turnkey where we can find that file in the following location:
http://<Apache-IP-Address>/status-server
This script is going to store this file in a local temporal file and parse these values in a Pandora-compatible XML format.
The script is the following:
pandora_apache.pl
Page 9
Once we have located the script and the values we want to monitor, include this file in pandora_agent.conf as a plugin agent. This plugin will create a module for each value, visible in thePandora server web interface.
Note: please change permissions to allow the script to be executed.
pandora_agent.conf is the configuration file of the Pandora Agent Software, and where all plugin agents must be located. This file can be found in:
/etc/pandora/pandora_agent.conf
We will write the following in the file to create the plugin agent for Pandora:
module_plugin <plugin-path>/pandora_apache.pl <username> <userpass> http://<ApacheServer-IP-Address>/server-status <command(wget|curl>
For instance:
module_plugin /etc/pandora/plugins/pandora_apache.pl user password http://127.0.0.1/server-status curl
module_plugin /etc/pandora/plugins/pandora_apache.pl none none http://127.0.0.1/server-status wget
Restart Pandora Agent and the Pandora Server will create a module for each data contained in the
Apache server-status page, from current requests to CPU load and ratios.
/etc/init.d/pandora_agent_daemon restart
Page 10