Bug 702662

Summary: [apache] The vhost ping URL might be incorrectly auto-discovered
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: low    
Version: 4.0.0CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Lukas Krejci 2011-05-06 10:07:34 EDT
Description of problem:

The discovery code assumes that the host specified in the ServerName directive of the virtual host definition is reachable and uses it in precedence to the actual vhost address definitions while composing the URL to ping for availability.

This might not be the case if name based virtual hosting is not used for that particular vhost.

For example if there was a load balancer in front of several apache instances that would forward traffic to a specified vhost in "our" instance, the ServerName directive would contain the "public facing" hostname of the load balancer which might not even be resolvable in the network our instance is part of.

Version-Release number of selected component (if applicable):
this is present in all versions of RHQ that have the apache plugin

How reproducible:

Steps to Reproduce:
1. Declare a vhost with a ServerName directive that specifies an unresolvable hostname
2.Discover the apache instance in RHQ
3.Check that the URL in the connection properties of the corresponding virtual host resource contains the hostname of the ServerName and port of the virtual host definition.
Actual results:
The vhost is assumed down because an incorrect URL was auto-discovered in its connection properties

Expected results:
The plugin should be smart enough to detect which vhosts use name based virtual hosting and modify the URL composition algorithm based on that fact

Additional info:
To workaround this bug, the user just needs to supply the correct URL in the connection settings of the virtual host resource.