Bug 690117

Summary: [apache] Unable to monitor virtual host with address specified as 0.0.0.0[:<port>]
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.0CC: hrupp, mazz, skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-04 03:16:05 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 919199, 678340    
Attachments:
Description Flags
Screenshot none

Description Lukas Krejci 2011-03-23 07:39:49 EDT
Description of problem:

when the "any address" IP address is specified in the vhost specification in the apache configuration, RHQ is unable to collect metrics on it with a log message like:

(org.rhq.plugins.apache.ApacheVirtualHostServiceComponent)- Unable to match the Virtual Host [0.0.0.0:80] with any of the SNMP advertised vhosts: [localhost, localhost]. It won't be possible to monitor the Virtual Host.
Version-Release number of selected component (if applicable):

Note that we also should detect the IP6 wildcard addresses (i.e. [::] or its "fuller" forms).

How reproducible:
always

Steps to Reproduce:
1. define a virtual host with 0.0.0.0 as its address in apache config
2. restart apache
3. discover the apache instance using RHQ
  
Actual results:
the virtual host "0.0.0.0:80" (or whatever port you've specified) is discovered but no metrics are collected on it and the above mentioned warning message appears in the agent.log

Expected results:
metrics collected, no warning in the logs

Additional info:
Comment 1 Lukas Krejci 2011-03-23 09:45:38 EDT
A workaround for virtual hosts is to replace the "0.0.0.0" with "*" (without quotes), which behaves the same except the fact that "*" allows IPv6 traffic.

For the Listen directive, the workaround is not to specify the IP/hostname at all and just specify the port. This has the same caveat with IPv6 traffic as the vhost workaround.
Comment 2 John Mazzitelli 2011-04-01 11:37:09 EDT
see if we can fix or at minimum document the workarounds somewhere
Comment 3 Lukas Krejci 2011-05-19 08:51:45 EDT
This should work in RHQ 4.0.x as a consequence of fixing bug 694476.
Comment 4 Sunil Kondkar 2011-06-29 05:15:38 EDT
Verified in Version: 4.1.0-SNAPSHOT Build Number: c57ee65

Defined a virtual host 0.0.0.0:8082 in httpd.conf and inventoried Apache. Created a script which wgets the URL http://0.0.0.0:8082. The monitoring tab displays data for the virtual host. Please refer the attached screenshot.

Marking as verified.
Comment 5 Sunil Kondkar 2011-06-29 05:16:43 EDT
Created attachment 510422 [details]
Screenshot
Comment 6 Heiko W. Rupp 2013-09-04 03:16:05 EDT
Fixed in an old RHQ release - closing now