Red Hat Bugzilla – Bug 690117
[apache] Unable to monitor virtual host with address specified as 0.0.0.0[:<port>]
Last modified: 2013-09-04 03:16:05 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).
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
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
metrics collected, no warning in the logs
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.
see if we can fix or at minimum document the workarounds somewhere
This should work in RHQ 4.0.x as a consequence of fixing bug 694476.
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.
Created attachment 510422 [details]
Fixed in an old RHQ release - closing now