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.
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:
Detailed configuration for a specific virtual server looks like this (for a whole server in hostname box type localhost):
After adding all the servers have to wait a few minutes and check if everything is ok:
The data are properly collected:
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.
One Comment
Leave a reply →