Piszki Lab | EN

My case study in the clouds…

vRealize Hyperic 5.8.4 – Monitor Apache server.

| 1 Comment

I have already written about this, but I will repeat it again. Hyperic is a brilliant solution to monitor almost everything, from servers to the application. In the case of VMware, Hyperic is added to many licenses, so you should use it. Its operation is fairly intuitive, perfectly integrates with other VMware solutions. In most cases, you just install the Agent which will detect all the necessary services. However, in the case of Apache is not that easy, we need to make a few extra steps.

apache318x260

Hyperic is able to monitor Apache using two different solutions, one is snmp module and the second is the server-status module. The first method requires compiling this module and is designed for specific versions of Apache which practically eliminates it. Server-status module is universal and available in almost every distribution. In this post I will be based on Apache 2.4 running on CentOS 7 and using virtual servers (vhost). Described configuration will work in every version and every distribution.

I assume that we already have installed Agent on your machine (and properly configured in Hyperic server). At the beginning, we must prepare HTTPD server, we can monitor the entire server or individual virtual servers. Check if in file /etc/httpd/conf.modules.d/00-base.conf got entry (in the default configuration will surely be):

LoadModule status_module modules/mod_status.so

In file “/etc/httpd/conf/httpd.conf” add:

EtendedStatus On

To monitor the entire server add to the vhost configuration file (on my server: /etc/httpd/conf.d/vhost.conf):

<VirtualHost localhost:80>
ServerName localhost:80
<Location /server-status>
SetHandler server-status
Allow From 127.0.0.1
</Location>
</VirtualHost>

To monitor individual virtual servers, on each section of this server, add an entry:

<Location /server-status>
SetHandler server-status
Allow From 127.0.0.1
</Location>

At the end, issue the command: systemctl reload httpd

Go to the Hyperic panel, we choose our platform (CentOS 7) and select the “Tools Menu -> New Server -> Apache HTTPD”, give the following parameters:

apache1

Detailed configuration for a specific virtual server looks like this (for a whole server in hostname box type localhost):

apache2

After adding all the servers have to wait a few minutes and check if everything is ok:

apache3

The data are properly collected:

apache4

When you use vSphere versions below 6.0, we can use AppHA to respond to the failure of the Apache server (send a notification, restart the application or restart the entire virtual machine). Unfortunately, since version 6.0 is not officially AppHA developed and supported (just do not know why). Perhaps that will change or will AppHA successor.

Rate this article:
[Total: 0 Average: 0]

Author: Piotr Pisz

Computer always, since I got a Commodore 64 at the end of primary school, through his beloved Amiga and Linux infinite number of consoles, until today, fully virtual day. Since 2001, Unix/Linux Systems Administrator, for seven years a faithful companion and protector of Solaris system, until his sad end. In the year 2011 came in the depths of virtualization, then smoothly ascended into the clouds and continues there today. Professionally working as Systems Architect in the Polish Security Printing Works.

One Comment

Leave a Reply

Required fields are marked *.