modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java | 7 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java | 6 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java | 109 +++++++--- modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java | 87 +++++-- modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java | 12 - modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java | 90 +++++--- 6 files changed, 208 insertions(+), 103 deletions(-)
New commits: commit 1afdc5b0c20f66a33f3f5965d5e4d7f8b014e9ac Author: Lukas Krejci lkrejci@redhat.com Date: Wed Oct 13 16:41:07 2010 +0200
BZ 642622 - Adding the ability to extract the scheme and port from the ServerName so that proper ping URLs can be discovered.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java index a725e57..9356ac9 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java @@ -248,7 +248,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen */ private static String getUrl(ApacheDirectiveTree serverConfig, String version) throws Exception { Address addr = HttpdAddressUtility.get(version).getMainServerSampleAddress(serverConfig, null, 0); - return addr == null ? null : "http://" + addr.host + ":" + addr.port + "/"; + return addr == null ? null : addr.toString(); }
@@ -423,4 +423,4 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen } return null; } -} \ No newline at end of file +} diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java index b2f76bc..8251658 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java @@ -124,7 +124,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
String url; if (hostToPing != null && portToPing != Address.PORT_WILDCARD_VALUE && portToPing != Address.NO_PORT_SPECIFIED_VALUE) { - url = "http://" + hostToPing + ":" + portToPing + "/"; + url = scheme + "://" + hostToPing + ":" + portToPing + "/"; } else { url = COULD_NOT_DETERMINE_THE_VIRTUAL_HOST_ADDRESS; } @@ -133,16 +133,18 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco pluginConfiguration.put(urlProp);
} - - File rtLogFile = new File(logsDir, address.host + address.port + RT_LOG_FILE_NAME_SUFFIX); - - PropertySimple rtLogProp = new PropertySimple( - ApacheVirtualHostServiceComponent.RESPONSE_TIME_LOG_FILE_CONFIG_PROP, rtLogFile.toString()); - pluginConfiguration.put(rtLogProp); - + + if (address != null) { + File rtLogFile = new File(logsDir, address.host + address.port + RT_LOG_FILE_NAME_SUFFIX); + + PropertySimple rtLogProp = new PropertySimple( + ApacheVirtualHostServiceComponent.RESPONSE_TIME_LOG_FILE_CONFIG_PROP, rtLogFile.toString()); + pluginConfiguration.put(rtLogProp); + } + String resourceName; if (serverName != null) { - resourceName = address.toString(); + resourceName = address.host + ":" + address.port; } else { resourceName = resourceKey; } diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java index c5589fd..b5cdedf 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java @@ -82,7 +82,7 @@ public enum HttpdAddressUtility { address = getLocalhost(address.port); }
- updateWithServerName(address, ag); + updateWithServerName(address, ag, false);
return address; } @@ -90,7 +90,7 @@ public enum HttpdAddressUtility {
return null; } catch (Exception e) { - log.info("Failed to obtain main server address. Is augeas installed and correct lens in use?"); + log.warn("Failed to obtain main server address.", e);
return null; } @@ -106,7 +106,7 @@ public enum HttpdAddressUtility { addr = getLocalhost(addr.port); }
- updateWithServerName(addr, ag); + updateWithServerName(addr, ag, false);
return addr; } @@ -115,7 +115,7 @@ public enum HttpdAddressUtility { //there has to be at least one Listen directive throw new IllegalStateException("Could find a listen address on port " + limitToPort); } catch (Exception e) { - log.info("Failed to obtain main server address. Is augeas installed and correct lens in use?"); + log.warn("Failed to obtain main server address.", e);
return null; } @@ -131,6 +131,7 @@ public enum HttpdAddressUtility { public static class Address { public String host; public int port = -1; + public String scheme = "http";
public static final String WILDCARD = "*"; public static final String DEFAULT_HOST = "_default_"; @@ -142,6 +143,10 @@ public enum HttpdAddressUtility { this.port = port; }
+ public Address(String scheme, String host, int port) { + this(host, port); + this.scheme = scheme; + } /** * A simple parser of the provided address into host and port * sections. @@ -150,6 +155,13 @@ public enum HttpdAddressUtility { * @return an instance of Address with host and port set accordingly */ public static Address parse(String address) { + String scheme = "http"; + int schemeSpecIdx = address.indexOf("://"); + if (schemeSpecIdx >= 0) { + scheme = address.substring(0, schemeSpecIdx); + address = address.substring(schemeSpecIdx + "://".length()); + } + int lastColonIdx = address.lastIndexOf(':'); if (lastColonIdx == NO_PORT_SPECIFIED_VALUE) { return new Address(address, -1); @@ -166,10 +178,10 @@ public enum HttpdAddressUtility { port = Integer.parseInt(portSpec); }
- return new Address(host, port); + return new Address(scheme, host, port); } else { //this is an IP6 address without a port spec - return new Address(address, NO_PORT_SPECIFIED_VALUE); + return new Address(scheme, address, NO_PORT_SPECIFIED_VALUE); } } } @@ -214,11 +226,11 @@ public enum HttpdAddressUtility {
@Override public String toString() { - if (port == NO_PORT_SPECIFIED_VALUE) return host; + if (port == NO_PORT_SPECIFIED_VALUE) return scheme + "://" + host; else { String portSpec = port == PORT_WILDCARD_VALUE ? WILDCARD : String.valueOf(port);
- return host + ":" + portSpec; + return scheme + "://" + host + ":" + portSpec; } } } @@ -245,30 +257,29 @@ public enum HttpdAddressUtility { * @return the address on which the virtual host can be accessed or null on error */ public Address getVirtualHostSampleAddress(ApacheDirectiveTree ag, String virtualHost, String serverName, boolean snmpModuleCompatibleMode) { - Address addr = Address.parse(virtualHost); - if (addr.isHostDefault() || addr.isHostWildcard()) { - Address serverAddr = null; - if (snmpModuleCompatibleMode) { - serverAddr = getLocalhost(addr.port); - } else { - serverAddr = getMainServerSampleAddress(ag, null, addr.port); + try { + Address addr = Address.parse(virtualHost); + if (addr.isHostDefault() || addr.isHostWildcard()) { + Address serverAddr = null; + if (snmpModuleCompatibleMode) { + serverAddr = getLocalhost(addr.port); + } else { + serverAddr = getMainServerSampleAddress(ag, null, addr.port); + } + if (serverAddr == null) + return null; + addr.host = serverAddr.host; } - if (serverAddr == null) - return null; - addr.host = serverAddr.host; - }
- if (serverName != null) { - int colonIdx = serverName.indexOf(':'); - if (colonIdx >= 0) { - addr.host = serverName.substring(0, colonIdx); - addr.port = Integer.parseInt(serverName.substring(colonIdx + 1)); - } else { - addr.host = serverName; + if (serverName != null) { + updateWithServerName(addr, serverName, true); } - }
- return addr; + return addr; + } catch (Exception e) { + log.warn("Failed to obtain virtual host address.", e); + return null; + } }
private static Address parseListen(String listenValue) { @@ -335,12 +346,12 @@ public enum HttpdAddressUtility { try { return new Address(InetAddress.getLocalHost().getHostAddress(), port); } catch (UnknownHostException e) { - //well, this is bad, we can get address of the localhost. let's use the force... + //well, this is bad, we can't get address of the localhost. let's use the force... return new Address("127.0.0.1", port); } }
- private static void updateWithServerName(Address address, ApacheDirectiveTree config) throws UnknownHostException { + private static void updateWithServerName(Address address, ApacheDirectiveTree config, boolean updatePort) throws UnknownHostException { //check if there is a ServerName directive List<ApacheDirective> serverNameNodes = config.search("/ServerName");
@@ -349,11 +360,20 @@ public enum HttpdAddressUtility { //be the case if the server listens on more than one interfaces. if (serverNameNodes.size() > 0) { String serverName = serverNameNodes.get(0).getValuesAsString(); - InetAddress addrFromServerName = InetAddress.getByName(serverName); - InetAddress addrFromAddress = InetAddress.getByName(address.host); - - if (addrFromAddress.equals(addrFromServerName)) { - address.host = serverName; + updateWithServerName(address, serverName, updatePort); + } + } + + private static void updateWithServerName(Address address, String serverName, boolean updatePort) throws UnknownHostException { + Address serverAddr = Address.parse(serverName); + InetAddress addrFromServerName = InetAddress.getByName(serverAddr.host); + InetAddress addrFromAddress = InetAddress.getByName(address.host); + + if (addrFromAddress.equals(addrFromServerName)) { + address.scheme = serverAddr.scheme; + address.host = serverAddr.host; + if (updatePort) { + address.port = serverAddr.port; } } }
commit fb4d2bdf36d713aa9bc9880db478efc81194c569 Author: Lukas Krejci lkrejci@redhat.com Date: Wed Oct 13 15:43:42 2010 +0200
BZ 642610 - directives found in included files aren't duplicated anymore
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java index 2e0f2a2..6cb168e 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java @@ -121,18 +121,6 @@ public class ApacheAugeasNode extends AugeasNodeLazy implements AugeasNode { childNodes.add(node); }
- public List<AugeasNode> getChildByLabel(String labelName) { - List<AugeasNode> nodes = super.getChildByLabel(labelName); - - if (includedNodes != null) { - for (AugeasNode node : includedNodes) { - if (node.getLabel().equals(labelName)) - nodes.add(node); - } - } - return nodes; - } - public void setPath(String path) throws AugeasTreeException { this.path = path;
commit 58db325cb1ae56114309c43b492d10ac6ab44139 Author: Lukas Krejci lkrejci@redhat.com Date: Wed Oct 13 15:42:17 2010 +0200
BZ 642591 - make sure we always have the same resource keys as in old plugin version.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java index c1f6323..4c61682 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java @@ -590,6 +590,13 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone }
/** + * @return The url the server is pinged for availability or null if the url is not set. + */ + public @Nullable String getServerUrl() { + return resourceContext.getPluginConfiguration().getSimpleValue(PLUGIN_CONFIG_PROP_URL, null); + } + + /** * Returns the httpd.conf file * @return A File object that represents the httpd.conf file or null in case of error */ diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java index d97d9fc..a0f2120 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java @@ -21,6 +21,8 @@ package org.rhq.plugins.apache; import java.io.File; import java.net.InetAddress; import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.UnknownHostException; import java.util.ArrayList; @@ -345,40 +347,77 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac List<AugeasNode> virtualHosts = new ArrayList<AugeasNode>(); boolean updated = false;
- for (AugeasNode node : nodes) { - updated = false; +//BZ 612189 - uncomment this algo once the resource upgrade is in place +// for (AugeasNode node : nodes) { +// updated = false; +// List<AugeasNode> serverNameNodes = tree.matchRelative(node, "ServerName/param"); +// String tempServerName = null; +// +// if (!(serverNameNodes.isEmpty())) { +// tempServerName = serverNameNodes.get(0).getValue(); +// } +// if (tempServerName == null & serverName == null) +// updated = true; +// if (tempServerName != null & serverName != null) +// if (tempServerName.equals(serverName)){ +// updated = true; +// } +// +// +// if (updated){ +// updated = false; +// List<AugeasNode> params = node.getChildByLabel("param"); +// for (AugeasNode nd : params) { +// updated = false; +// for (String adr : addrs) { +// if (adr.equals(nd.getValue())) +// updated = true; +// } +// if (!updated) +// break; +// } +// +// if (updated) +// virtualHosts.add(node); +// } +// } + + //BZ 612189 - remove this once resource upgrade is in place + HttpdAddressUtility.Address resourceKeyAddress = HttpdAddressUtility.Address.parse(resourceKey); + for(AugeasNode node : nodes) { List<AugeasNode> serverNameNodes = tree.matchRelative(node, "ServerName/param"); - String tempServerName = null; - - if (!(serverNameNodes.isEmpty())) { - tempServerName = serverNameNodes.get(0).getValue(); - } - if (tempServerName == null & serverName == null) - updated = true; - if (tempServerName != null & serverName != null) - if (tempServerName.equals(serverName)){ - updated = true; - } + List<AugeasNode> vhostAddressNodes = node.getChildByLabel("param"); + + String vhostServerName = serverNameNodes.isEmpty() ? null : serverNameNodes.get(0).getValue(); + String vhostAddressDef = vhostAddressNodes.isEmpty() ? null : vhostAddressNodes.get(0).getValue(); + + if (vhostAddressDef != null) { + HttpdAddressUtility.Address vhostAddress = HttpdAddressUtility.Address.parse(vhostAddressDef); + if (vhostServerName != null) { + HttpdAddressUtility.Address vhostServerAddress = HttpdAddressUtility.Address.parse(vhostServerName); + vhostAddress.host = vhostServerAddress.host; + }
- - if (updated){ - updated = false; - List<AugeasNode> params = node.getChildByLabel("param"); - for (AugeasNode nd : params) { - updated = false; - for (String adr : addrs) { - if (adr.equals(nd.getValue())) - updated = true; - } - if (!updated) - break; - } - - if (updated) - virtualHosts.add(node); + if (resourceKeyAddress.equals(vhostAddress)) { + virtualHosts.add(node); } - } - + } + } + + //BZ 612189 - remove this once we have resource upgrade + //ok, one final attempt... the legacy resource key format for the MainServer is just a host:port as with the rest of the vhosts, let's try that + try { + String serverUrl = resourceContext.getParentResourceComponent().getServerUrl(); + URI serverUri = new URI(serverUrl); + String expectedResourceKey = serverUri.getHost() + ":" + serverUri.getPort(); + + if (expectedResourceKey.equals(resourceKey)) { + return tree.getRootNode(); + } + } catch (URISyntaxException e) { + log.warn("Failed to parse the server URL when trying to match the vhost with the main server.", e); + } + if (virtualHosts.size() == 0) { throw new IllegalStateException("Could not find virtual host configuration in augeas for virtual host: " + resourceKey); @@ -505,6 +544,14 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac vhostServerName, true); if (vhostAddr != null) { vhostAddresses.add(vhostAddr); + } else { + //this is not to choke on the old style resource keys for the main server. without this, we'd never be able + //to match the main server with its snmp index below. + HttpdAddressUtility.Address addr = HttpdAddressUtility.Address.parse(vhostAddressStrings[i]); + vhostAddr = parent.getAddressUtility().getMainServerSampleAddress(tree, addr.host, addr.port); + if (vhostAddr != null) { + vhostAddresses.add(vhostAddr); + } } } } diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java index 4a32e27..b2f76bc 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java @@ -19,7 +19,10 @@ package org.rhq.plugins.apache;
import java.io.File; +import java.net.InetAddress; import java.net.URI; +import java.net.URISyntaxException; +import java.net.UnknownHostException; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; @@ -37,6 +40,7 @@ import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; import org.rhq.plugins.apache.parser.ApacheDirective; import org.rhq.plugins.apache.parser.ApacheDirectiveTree; +import org.rhq.plugins.apache.util.HttpdAddressUtility; import org.rhq.plugins.apache.util.HttpdAddressUtility.Address; import org.rhq.plugins.www.snmp.SNMPException; import org.rhq.plugins.www.snmp.SNMPSession; @@ -91,23 +95,13 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco serverName = serverNames.get(0).getValuesAsString(); }
- StringBuilder keyBuilder = new StringBuilder(); - if (serverName != null) { - keyBuilder.append(serverName).append("|"); - } - keyBuilder.append(firstAddress); - - - for (int i=1;i<hosts.size();i++){ - keyBuilder.append(" ").append(hosts.get(i)); - } - - String resourceKey = keyBuilder.toString(); + String resourceKey = createResourceKey(serverName, hosts);
Configuration pluginConfiguration = context.getDefaultPluginConfiguration();
Address address = serverComponent.getAddressUtility().getVirtualHostSampleAddress(tree, firstAddress, serverName, false); if (address != null) { + String scheme = address.scheme; String hostToPing = address.host; int portToPing = address.port; if (address.isPortWildcard()) { @@ -178,6 +172,9 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
String mainServerUrl = context.getParentResourceContext().getPluginConfiguration().getSimple( ApacheServerComponent.PLUGIN_CONFIG_PROP_URL).getStringValue(); + + String key = null; + if (mainServerUrl != null && !"null".equals(mainServerUrl)) { PropertySimple mainServerUrlProp = new PropertySimple(ApacheVirtualHostServiceComponent.URL_CONFIG_PROP, mainServerUrl); @@ -196,9 +193,15 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco PropertySimple rtLogProp = new PropertySimple( ApacheVirtualHostServiceComponent.RESPONSE_TIME_LOG_FILE_CONFIG_PROP, rtLogFile.toString()); mainServerPluginConfig.put(rtLogProp); + + //BZ 612189 - remove this once we have resource upgrade + key = host + ":" + port; }
- String key = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY; + //BZ 612189 - this can simply the MAIN_SERVER_RESOURCE_KEY only once we have resource upgrade + if (key == null) { + key = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY; + }
//BZ 612189 - remove this once we have resource upgrade if (snmpDiscoveries != null) { @@ -237,6 +240,42 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco } }
+ public static String createResourceKey(String serverName, List<String> hosts) { +//BZ 612189 - swap the impls once resource upgrade is in place +// StringBuilder keyBuilder = new StringBuilder(); +// if (serverName != null) { +// keyBuilder.append(serverName).append("|"); +// } +// keyBuilder.append(hosts.get(0)); +// +// +// for (int i = 1; i < hosts.size(); ++i){ +// keyBuilder.append(" ").append(hosts.get(i)); +// } +// +// return keyBuilder.toString(); + + //try to derive the same resource key as the SNMP would have... this is to prevent the duplication of + //vhost resources after the SNMP was configured - how I wish resource upgrade made it to 3.0 to prevent this + //kind of guessing being necessary. + String host = hosts.get(0); + HttpdAddressUtility.Address hostAddr = HttpdAddressUtility.Address.parse(host); + if (serverName != null) { + HttpdAddressUtility.Address serverAddr = HttpdAddressUtility.Address.parse(serverName); + hostAddr.host = serverAddr.host; + } + + //the SNMP module seems to resolve the IPs to hostnames. + try { + InetAddress hostName = InetAddress.getByName(hostAddr.host); + hostAddr.host = hostName.getHostName(); + } catch (UnknownHostException e) { + log.debug("Host " + hostAddr.host + " is not resolvable.", e); + } + + return hostAddr.host + ":" + hostAddr.port; + } + /** * @deprecated remove this once we have resource upgrade * @param discoveryContext @@ -279,7 +318,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
return ret; } catch (Exception e) { - log.warn("Error while trying to contact SNMP of the apache server " + discoveryContext.getParentResourceContext().getResourceKey()); + log.warn("Error while trying to contact SNMP of the apache server " + discoveryContext.getParentResourceContext().getResourceKey(), e); return null; } }
commit e8bfc17fde0d6f5bc837d2a96f230a8109114279 Author: Lukas Krejci lkrejci@redhat.com Date: Wed Oct 13 15:33:57 2010 +0200
BZ 642588 - config is reloaded if ServerRoot is redefined in config
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java index 9c2e448..a725e57 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java @@ -137,6 +137,8 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen if (!serverRoots.isEmpty()) { serverRoot = AugeasNodeValueUtil.unescape(serverRoots.get(0).getValuesAsString()); serverRootProp.setValue(serverRoot); + //reparse the configuration with the new ServerRoot + serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot); }
serverUrl = getUrl(serverConfig, binaryInfo.getVersion());
rhq-commits@lists.fedorahosted.org