Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Pandora FMS: Apache server monitoring

945 views

Published on

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

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Pandora FMS: Apache server monitoring

  1. 1. Pandora FMS Administrator Manual Apache WebServer Monitoring
  2. 2. Administrator Manual Apache WebServer Monitoring © Artica Soluciones Tecnológicas 2005-2012 Index 1Changelog...........................................................................................................................................3 2Introduction........................................................................................................................................4 3Compatibility Matrix..........................................................................................................................5 4Documentation provided by the requesting area................................................................................6 5Modules of Apache Webserver available...........................................................................................7 6Monitoring Apache Webserver..........................................................................................................8 6.1.Monitoring via plugins and modules.........................................................................................8 6.1.1.Plugin Agent (local method) .............................................................................................9
  3. 3. 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
  4. 4. 2 INTRODUCTION This plugin allow you to monitor the Apache Web server status using mod_status. 3 COMPATIBILITY MATRIX Page 4
  5. 5. 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
  6. 6. 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
  7. 7. 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
  8. 8. 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 Apache 2.x) or status.conf (some Apache 2 versions and Turnkeys) These files can be respectively found in: Page 8
  9. 9. /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
  10. 10. 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 the Pandora 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

×