modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 20 modules/enterprise/server/sars/agent-sar/pom.xml | 21 modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java | 326 ++- modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java | 24 modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml | 1062 ---------- modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml | 12 modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml | 129 - modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties | 29 modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml | 1062 ++++++++++ modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml | 4 modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties | 2 11 files changed, 1388 insertions(+), 1303 deletions(-)
New commits: commit 595abdb8a046e31c3528a6482b438ef6e731fef3 Author: John Mazzitelli mazz@redhat.com Date: Tue Oct 2 01:57:15 2012 -0400
try to resurrect embedded agent. this still doesn't work in AS7 due to JMX deps. I think its best to move the sar's embedded agent into an AS7 module
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml index f060121..2a5da0d 100644 --- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml +++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml @@ -244,13 +244,11 @@ dest="${jboss.deploy.dir}/rhq-installer.war" /> <touch file="${jboss.deploy.dir}/rhq-installer.war.dodeploy" />
- <!-- TODO: deploy embedded agent sar --> - <!-- <echo>Deploying embedded agent sar ...</echo> <mkdir dir="${jboss.deploy.dir}/rhq-agent.sar" /> <unjar src="${settings.localRepository}/org/rhq/rhq-enterprise-server-agent-sar/${rhq.version}/rhq-enterprise-server-agent-sar-${rhq.version}.sar" dest="${jboss.deploy.dir}/rhq-agent.sar" /> - --> + <touch file="${jboss.deploy.dir}/rhq-agent.sar.skipdeploy" /> <!-- TODO: make this dodeploy -->
<echo>Delete docs, README, et. al. files</echo> <delete dir="${jboss.home}/docs/examples" /> @@ -419,13 +417,13 @@ rhq.server.tomcat.security.truststore.type=JKS # Server-side SSL Security Configuration (for incoming messages from agents) # These are used when secure transports other than sslservlet are used rhq.communications.connector.security.secure-socket-protocol=TLS -rhq.communications.connector.security.keystore.file=${jboss.server.home.dir}/conf/rhq.keystore +rhq.communications.connector.security.keystore.file=${jboss.server.config.dir}/rhq.keystore rhq.communications.connector.security.keystore.algorithm=SunX509 rhq.communications.connector.security.keystore.type=JKS rhq.communications.connector.security.keystore.password=RHQManagement rhq.communications.connector.security.keystore.key-password=RHQManagement rhq.communications.connector.security.keystore.alias=RHQ -rhq.communications.connector.security.truststore.file=${jboss.server.home.dir}/conf/rhq.truststore +rhq.communications.connector.security.truststore.file=${jboss.server.config.dir}/rhq.truststore rhq.communications.connector.security.truststore.algorithm=SunX509 rhq.communications.connector.security.truststore.type=JKS rhq.communications.connector.security.truststore.password=RHQManagement @@ -433,13 +431,13 @@ rhq.communications.connector.security.client-auth-mode=none
# Client-side SSL Security Configuration (for outgoing messages to agents) rhq.server.client.security.secure-socket-protocol=TLS -rhq.server.client.security.keystore.file=${jboss.server.home.dir}/conf/rhq.keystore +rhq.server.client.security.keystore.file=${jboss.server.config.dir}/rhq.keystore rhq.server.client.security.keystore.algorithm=SunX509 rhq.server.client.security.keystore.type=JKS rhq.server.client.security.keystore.password=RHQManagement rhq.server.client.security.keystore.key-password=RHQManagement rhq.server.client.security.keystore.alias=RHQ -rhq.server.client.security.truststore.file=${jboss.server.home.dir}/conf/rhq.truststore +rhq.server.client.security.truststore.file=${jboss.server.config.dir}/rhq.truststore rhq.server.client.security.truststore.algorithm=SunX509 rhq.server.client.security.truststore.type=JKS rhq.server.client.security.truststore.password=RHQManagement @@ -583,14 +581,6 @@ rhq.autoinstall.public-endpoint-address= <echo>!!THIS IS A DEVELOPER CONTAINER BUILD - PRE-DEPLOYING RHQ SERVER!!</echo> </target>
- <!-- TODO: when we ship with an embedded agent --> - <!-- - <target name="undeploy-embedded-agent" unless="predeploy"> - <echo>Preparing for release - undeploying Embedded Agent...</echo> - <move file="${jboss.deploy.dir}/rhq-agent.sar" tofile="${jboss.deploy.dir}/rhq-agent.sar.skipdeploy" /> - </target> - --> - <target name="undeploy-ear" unless="predeploy"> <echo>Preparing for release - telling AS to skip ear deployment</echo> <touch file="${jboss.deploy.dir}/${rhq.earName}.skipdeploy" /> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 2763936..914cde2 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -26,12 +26,6 @@ <version>${project.version}</version> </dependency>
- <dependency> - <groupId>org.rhq</groupId> - <artifactId>rhq-core-domain</artifactId> - <version>${project.version}</version> - </dependency> - <!-- we want to explicitly include these (do not use scope=provided) --> <dependency> <groupId>commons-logging</groupId> @@ -73,15 +67,20 @@ <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> - <!-- we are packaging the agent in isolation - but the sar needs the agent jar itself, put a copy in the lib directory --> + <!-- we are packaging the agent in isolation - but the sar needs the agent jar/core-util jars, put a copy in the lib directory --> <execution> <phase>package</phase> <configuration> <target> <echo>sarDirectory="${sarDirectory}"</echo> - <echo>Putting the agent jar in the sar's classpath</echo> + <echo>Putting some jars required by the embedded agent bootstrap service in the sar's classpath</echo> + <!-- if you add jars in here, make sure you add them in jboss-deployment-structure.xml also --> <mkdir dir="${sarDirectory}/lib" /> <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-enterprise-agent-${project.version}.jar" todir="${sarDirectory}/lib" /> + <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-enterprise-comm-${project.version}.jar" todir="${sarDirectory}/lib" /> + <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-core-comm-api-${project.version}.jar" todir="${sarDirectory}/lib" /> + <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-core-util-${project.version}.jar" todir="${sarDirectory}/lib" /> + <copy file="${sarDirectory}/META-INF/embedded-agent/lib/i18nlog-${i18nlog.version}.jar" todir="${sarDirectory}/lib" />
<echo>Populating the sar with the native libraries found at ${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}/sigar-dist-${sigar.version}.zip</echo> <unzip dest="${sarDirectory}/META-INF/embedded-agent/lib"> @@ -100,13 +99,15 @@ <include name="**/lib/*" /> </fileset> </move> - <delete dir="${sarDirectory}/META-INF/embedded-agent/lib/hyperic-sigar-${sigar.version}" /> + + <delete includeemptydirs="true"> + <fileset dir="${sarDirectory}/META-INF/embedded-agent/lib/" includes="hyperic-sigar*/**"/> + </delete>
<echo>Removing libraries that are either unused or in the RHQ Server's JBossAS endorsed dir</echo> <delete> <fileset dir="${sarDirectory}/META-INF/embedded-agent/lib"> <include name="jdom*.jar" /> <!-- never needed; only for deprecated XML code for the license stuff --> - <include name="jaxb*.jar" /> <!-- JAXB is in JBossAS's endorsed directory --> </fileset> </delete>
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java index 2c866a2..d39e05e 100644 --- a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java +++ b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java @@ -30,6 +30,7 @@ import java.net.InetAddress; import java.net.URL; import java.net.UnknownHostException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Map; import java.util.Properties; import java.util.prefs.BackingStoreException; @@ -67,7 +68,12 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ /** * The location of the configuration file - can be a file path or path within classloader. */ - private String configFile = "META-INF/embedded-agent-configuration.xml"; + private String configFile = "embedded-agent-configuration.xml"; + + /** + * The location of the configuration overrides properties file - can be a URL, file path or path within classloader. + */ + private String overridesFile = null; // the jboss-service.xml service descriptor must set this
/** * The preferences node name that identifies the configuration set used to configure the services. @@ -78,7 +84,7 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ * Properties that will be used to override preferences found in the preferences node and the configuration * preferences file. */ - private Properties configurationOverrides = null; + private Properties configurationOverrides = new Properties();
/** * Arguments passed to the agent's main method. @@ -107,8 +113,9 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ * * @see EmbeddedAgentBootstrapServiceMBean#startAgent() */ + @Override public void startAgent() throws Exception { - //-- if this method signature changes, you must also change StartupServlet.startEmbeddedAgent + //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent
if (!enabled.booleanValue()) { log.info("Will not start the embedded RHQ agent - it is disabled"); @@ -143,7 +150,8 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ try { Class<?> agentClass = agentClassLoader.loadClass("org.rhq.enterprise.agent.AgentMain"); Constructor<?> agentConstructor = agentClass.getConstructor(new Class[] { String[].class }); - Object agentInstance = agentConstructor.newInstance(new Object[] { getAgentArguments() }); + Object agentInstance = agentConstructor + .newInstance(new Object[] { getAgentArgumentsAsArray() });
agentClass.getMethod("start", new Class[0]).invoke(agentInstance, new Object[0]);
@@ -177,6 +185,7 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ return; }
+ @Override public void stopAgent() throws Exception { if (agent != null) { log.info("Stopping the embedded RHQ Agent..."); @@ -217,60 +226,86 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ } }
+ public void start() throws Exception { + return; // no-op + } + // this method is needed so the JBossAS server will call it when shutting down the service + @Override public void stop() throws Exception { stopAgent(); }
+ @Override public boolean isAgentStarted() { return agent != null; }
+ @Override public String getAgentEnabled() { - //-- if this method signature changes, you must also change StartupServlet.startEmbeddedAgent + //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent return enabled.toString(); }
+ @Override public void setAgentEnabled(String flag) { - enabled = Boolean.valueOf(flag.trim()); + enabled = Boolean.valueOf(replaceProperties(flag)); }
+ @Override public String getResetConfiguration() { return resetConfigurationAtStartup.toString(); }
+ @Override public void setResetConfiguration(String flag) { - resetConfigurationAtStartup = Boolean.valueOf(flag.trim()); + resetConfigurationAtStartup = Boolean.valueOf(replaceProperties(flag)); }
- public File getEmbeddedAgentDirectory() { - return embeddedAgentDirectory; + @Override + public String getEmbeddedAgentDirectory() { + return embeddedAgentDirectory.getAbsolutePath(); }
- public void setEmbeddedAgentDirectory(File directory) { - if (!directory.exists() || !directory.isDirectory()) { + @Override + public void setEmbeddedAgentDirectory(String directoryStr) { + File directory = null; + + if (directoryStr != null) { + directoryStr = replaceProperties(directoryStr); + directory = new File(directoryStr); + } + + if (directory == null || !directory.exists() || !directory.isDirectory()) { enabled = Boolean.FALSE; - embeddedAgentDirectory = null; - throw new IllegalArgumentException( - "Invalid embedded agent directory specified - embedded agent has been disabled: " + directory); + directory = null; + log.warn("Invalid embedded agent directory specified - embedded agent has been disabled: " + directory); }
embeddedAgentDirectory = directory; }
+ @Override public String getConfigurationFile() { return configFile; }
+ @Override public void setConfigurationFile(String location) { - configFile = StringPropertyReplacer.replaceProperties(location); + configFile = replaceProperties(replaceProperties(location)); }
+ @Override public String getPreferencesNodeName() { return preferencesNodeName; }
+ @Override public void setPreferencesNodeName(String node) { + if (node != null) { + node = replaceProperties(node); + } + if (node == null || node.trim().length() == 0) { try { node = InetAddress.getLocalHost().getCanonicalHostName(); @@ -279,18 +314,32 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ } node = node + "-embedded"; } - preferencesNodeName = StringPropertyReplacer.replaceProperties(node); + preferencesNodeName = replaceProperties(node); System.setProperty("rhq.server.embedded-agent.preferences-node", preferencesNodeName); }
+ @Override public Properties getConfigurationOverrides() { - //-- if this method signature changes, you must also change StartupServlet.startEmbeddedAgent + //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent return configurationOverrides; }
+ @Override public void setConfigurationOverrides(Properties overrides) { - //-- if this method signature changes, you must also change StartupServlet.startEmbeddedAgent - configurationOverrides = overrides; + //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent + + if (overrides == null) { + return; // do nothing + } + + for (String propName : overrides.stringPropertyNames()) { + String origValue = overrides.getProperty(propName); + String newValue = replaceProperties(origValue); + overrides.setProperty(propName, newValue); + } + + configurationOverrides.clear(); + configurationOverrides.putAll(overrides);
// perform some checking to setup defaults if need be
@@ -304,17 +353,28 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ agent_name = "${jboss.bind.address}"; } agent_name = agent_name + "-embedded"; - agent_name = StringPropertyReplacer.replaceProperties(agent_name); + agent_name = replaceProperties(agent_name); configurationOverrides.put("rhq.agent.name", agent_name); } + + return; + } + + @Override + public String getAgentArguments() { + // this only returns a human readable string - to use the args, use getAgentArgumentsAsArray instead + String[] allArgs = getAgentArgumentsAsArray(); + return Arrays.toString(allArgs); }
- public String[] getAgentArguments() { + // we want to use this because it adds some required args + private String[] getAgentArgumentsAsArray() { ArrayList<String> args = new ArrayList<String>();
if (arguments != null) { for (String argument : arguments) { - args.add(argument); + String realArg = replaceProperties(argument); + args.add(realArg); } }
@@ -323,16 +383,23 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ return args.toArray(new String[args.size()]); }
- public void setAgentArguments(String[] args) { - arguments = args; + @Override + public void setAgentArguments(String args) { + if (args != null) { + arguments = args.split(","); + } else { + arguments = new String[0]; + } }
+ @Override public void reloadAgentConfiguration() throws Exception { getPreferencesNode().clear();
prepareConfigurationPreferences(); }
+ @Override public void cleanDataDirectory() { AgentConfiguration config = new AgentConfiguration(getPreferencesNode()); File data_dir = config.getDataDirectory(); @@ -349,6 +416,7 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ return; }
+ @Override public Properties getAgentConfiguration() { try { Properties properties = new Properties(); @@ -364,6 +432,7 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ } }
+ @Override public void executeAgentPromptCommand(final String command) { // all this funky threading/reflection is so we execute the command // in the isoloated context of the embedded agent @@ -402,6 +471,85 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ return; }
+ @Override + public String getConfigurationOverridesFile() { + return overridesFile; + } + + @Override + public void setConfigurationOverridesFile(String location) { + if (location == null) { + overridesFile = null; + } else { + // substitute ${} replacement variables found in the location string + overridesFile = replaceProperties(location); + try { + loadConfigurationOverridesFromFile(); + } catch (Exception e) { + log.warn("Cannot load embedded agent config overrides file [" + overridesFile + "]", e); + } + } + } + + private void loadConfigurationOverridesFromFile() throws Exception { + if (overridesFile == null) { + return; // nothing to do + } + + InputStream is = getFileInputStream(overridesFile); + try { + Properties props = new Properties(); + props.load(is); + setConfigurationOverrides(props); + } finally { + is.close(); // if we got here, "is" will never be null + } + + return; + } + + /** + * Loads a file either from file system, from URL or from classloader. If file + * can't be found, exception is thrown. + * @param file_name the file whose input stream is to be returned + * @return input stream of the file - will never be null + * @throws IOException if the file input stream cannot be obtained + */ + private InputStream getFileInputStream(String file_name) throws IOException { + // first see if the file was specified as a path on the local file system + InputStream config_file_input_stream = null; + try { + File config_file = new File(file_name); + + if (config_file.exists()) { + config_file_input_stream = new FileInputStream(config_file); + } + } catch (Exception e) { + // isn't really an error - this just isn't a file on the local file system + } + + // see if the file was specified as a URL + if (config_file_input_stream == null) { + try { + URL config_file = new URL(file_name); + + config_file_input_stream = config_file.openStream(); + } catch (Exception e) { + // isn't really an error - this just isn't a URL + } + } + + // if neither a file path or URL, assume the config file can be found in the classloader + if (config_file_input_stream == null) { + config_file_input_stream = this.getClass().getClassLoader().getResourceAsStream(file_name); + } + + if (config_file_input_stream == null) { + throw new IOException("Cannot find config file for embedded agent: " + file_name); + } + return config_file_input_stream; + } + /** * This will return URLs to all of the jars and resources that the embedded agent will have access to in its * isolated classloader. Only those classes within these jars will be accessible to the embedded agent. Even classes @@ -428,6 +576,29 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ classpathUrls.add(jarFile.toURI().toURL()); }
+ // we need jboss-modules.jar because in AS7 it is used to override JAXP impl classes and we can't not use it + URL jbossModules = null; + String cp = System.getProperty("java.class.path"); + if (cp != null && cp.contains("jboss-modules.jar")) { + for (String cpPath : cp.split(File.pathSeparator)) { + if (cpPath.contains("jboss-modules.jar")) { + jbossModules = new File(cpPath).toURI().toURL(); + classpathUrls.add(jbossModules); + break; + } + } + } + + if (jbossModules == null) { + File rootLocation = new File(System.getProperty("jboss.home.dir"), "jboss-modules.jar"); + if (rootLocation.exists()) { + jbossModules = rootLocation.toURI().toURL(); + classpathUrls.add(jbossModules); + } else { + throw new IllegalStateException( + "Cannot find jboss-modules.jar - it is necessary for embedded agent to run."); + } + } return classpathUrls.toArray(new URL[classpathUrls.size()]); }
@@ -493,7 +664,7 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ String value = entry.getValue().toString();
// allow ${var} notation in the values so we can provide variable replacements in the values - value = StringPropertyReplacer.replaceProperties(value); + value = replaceProperties(value);
preferences_node.put(key, value); } @@ -521,38 +692,8 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ private AgentConfiguration loadConfigurationFile() throws Exception { String file_name = getConfigurationFile(); String preferences_node_name = getPreferencesNodeName(); - InputStream config_file_input_stream = null;
- // first see if the file was specified as a path on the local file system - try { - File config_file = new File(file_name); - - if (config_file.exists()) { - config_file_input_stream = new FileInputStream(config_file); - } - } catch (Exception e) { - // isn't really an error - this just isn't a file on the local file system - } - - // see if the file was specified as a URL - if (config_file_input_stream == null) { - try { - URL config_file = new URL(file_name); - - config_file_input_stream = config_file.openStream(); - } catch (Exception e) { - // isn't really an error - this just isn't a URL - } - } - - // if neither a file path or URL, assume the config file can be found in the classloader - if (config_file_input_stream == null) { - config_file_input_stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(file_name); - } - - if (config_file_input_stream == null) { - throw new IOException("Bad config file: " + file_name); - } + InputStream config_file_input_stream = getFileInputStream(file_name);
// We need to clear out any previous configuration in case the current config file doesn't specify a preference // that already exists in the preferences node. In this case, the configuration file wants to fall back on the @@ -561,37 +702,42 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ // But first we need to backup these original preferences in case the config file fails to load - // we'll restore the original values in that case.
- Preferences preferences_node = getPreferencesNode(); - ByteArrayOutputStream backup = new ByteArrayOutputStream(); - preferences_node.exportSubtree(backup); - preferences_node.clear(); - - // now load in the preferences try { - ByteArrayOutputStream raw_config_file = new ByteArrayOutputStream(); - StreamUtil.copy(config_file_input_stream, raw_config_file, true); - String new_config = StringPropertyReplacer.replaceProperties(raw_config_file.toString()); - ByteArrayInputStream new_config_input_stream = new ByteArrayInputStream(new_config.getBytes()); - Preferences.importPreferences(new_config_input_stream); - - if (new AgentConfiguration(preferences_node).getAgentConfigurationVersion() == 0) { - throw new IllegalArgumentException("Bad node name: " + preferences_node_name); - } - } catch (Exception e) { - // a problem occurred importing the config file; let's restore our original values + Preferences preferences_node = getPreferencesNode(); + ByteArrayOutputStream backup = new ByteArrayOutputStream(); + preferences_node.exportSubtree(backup); + preferences_node.clear(); + + // now load in the preferences try { - Preferences.importPreferences(new ByteArrayInputStream(backup.toByteArray())); - } catch (Exception e1) { - // its conceivable the same problem occurred here as with the original exception (backing store problem?) - // let's throw the original exception, not this one - } + ByteArrayOutputStream raw_config_file = new ByteArrayOutputStream(); + StreamUtil.copy(config_file_input_stream, raw_config_file, true); + String new_config = replaceProperties(raw_config_file.toString()); + ByteArrayInputStream new_config_input_stream = new ByteArrayInputStream(new_config.getBytes()); + Preferences.importPreferences(new_config_input_stream); + + if (new AgentConfiguration(preferences_node).getAgentConfigurationVersion() == 0) { + throw new IllegalArgumentException("Bad node name: " + preferences_node_name); + } + } catch (Exception e) { + // a problem occurred importing the config file; let's restore our original values + try { + Preferences.importPreferences(new ByteArrayInputStream(backup.toByteArray())); + } catch (Exception e1) { + // its conceivable the same problem occurred here as with the original exception (backing store problem?) + // let's throw the original exception, not this one + }
- throw e; - } + throw e; + }
- AgentConfiguration agent_configuration = new AgentConfiguration(preferences_node); + AgentConfiguration agent_configuration = new AgentConfiguration(preferences_node);
- return agent_configuration; + return agent_configuration; + } finally { + // we know this is not null; if it was, we would have thrown the IOException earlier. + config_file_input_stream.close(); + } }
/** @@ -630,4 +776,20 @@ public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServ
return; } + + private String replaceProperties(String str) { + if (str == null) { + return null; + } + + // keep replacing properties until no more ${} tokens are left that are replaceable + String newValue = ""; + String oldValue = str; + while (!newValue.equals(oldValue)) { + oldValue = str; + newValue = StringPropertyReplacer.replaceProperties(str); + str = newValue; + } + return newValue; + } } \ No newline at end of file diff --git a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java index f71b4f2..0adeb17 100644 --- a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java +++ b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java @@ -18,10 +18,7 @@ */ package org.rhq.enterprise.server.agent;
-import java.io.File; import java.util.Properties; -import javax.management.ObjectName; -import org.jboss.mx.util.ObjectNameFactory;
/** * The interface to the MBean that embeds a JON Agent in the JON Server. @@ -32,7 +29,7 @@ public interface EmbeddedAgentBootstrapServiceMBean { /** * The object name that the MBean service will be registered under. */ - ObjectName OBJECT_NAME = ObjectNameFactory.create("rhq:service=EmbeddedAgentBootstrap"); + String OBJECT_NAME = "rhq:service=EmbeddedAgentBootstrap";
/** * If <code>true</code>, this indicates that the agent should be started when the JON Server is started. This @@ -81,7 +78,7 @@ public interface EmbeddedAgentBootstrapServiceMBean { * * @return location of the embedded agent and its resources */ - File getEmbeddedAgentDirectory(); + String getEmbeddedAgentDirectory();
/** * Indicates the location where the embedded agent and all its resources will be found. There must be a <code> @@ -90,7 +87,7 @@ public interface EmbeddedAgentBootstrapServiceMBean { * * @param directory location of the embedded agent and its resources */ - void setEmbeddedAgentDirectory(File directory); + void setEmbeddedAgentDirectory(String directory);
/** * Returns the location of the configuration file where all agent preferences are defined. The file location can be @@ -144,18 +141,29 @@ public interface EmbeddedAgentBootstrapServiceMBean { void setConfigurationOverrides(Properties overrides);
/** + * This allows you to explicitly override configuration preferences found in the configuration file. If this isn't + * set, then the settings specified by the configuration preferences file take effect as-is. If this is set, + * this file is a properties file whose values will override the config file prefs. + * + * @param overrides configuration settings file that override the configuration preferences (may be<code>null</code>) + */ + void setConfigurationOverridesFile(String overridesFile); + + String getConfigurationOverridesFile(); + + /** * Returns the arguments that are passed to the agent's main startup method. * * @return agent arguments */ - String[] getAgentArguments(); + String getAgentArguments();
/** * Sets the arguments that will be passed to the agent's main startup method. * * @param args */ - void setAgentArguments(String[] args); + void setAgentArguments(String args);
/** * This will clear any and all current configuration preferences and then reload the diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml deleted file mode 100644 index a9a8b77..0000000 --- a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml +++ /dev/null @@ -1,1062 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'> - -<!-- -============================================================================== -Embedded RHQ Agent Configuration -============================================================================== ---> - -<preferences EXTERNAL_XML_VERSION="1.0"> - <root type="user"> - <map /> - <node name="rhq-agent"> - <map /> - <node name="${rhq.server.embedded-agent.preferences-node}"> - <map> - <!-- - _______________________________________________________________ - rhq.agent.configuration-schema-version - - Defines what version of the agent configuration schema this - file conforms to. This is the schema for the rhq.agent - preferences. - --> - <entry key="rhq.agent.configuration-schema-version" value="6" /> - - <!-- - _______________________________________________________________ - rhq.agent.configuration-setup-flag - - If true, the agent will assume it is fully configured and - will not ask setup questions when it starts up. If false, - the agent assumes the configuration is not complete and - will ask a series of setup questions to the user in order - to be fully configured. - - If you write your own custom agent configuration file, you - will probably want to set this flag to true since you - probably will set all of your configuration right in the - configuration file itself. However, you may wish to - distribute agent configuration files with only a subset - of configuration preferences set and rely on each agent's - startup setup mechanism to finish its configuration - in this - case, you'll want to leave this as false. - - EMBEDDED: this is true - we ensure the agent is fully - configured; we have to since the agent has no console - interface and must start in daemon mode - --> - <entry key="rhq.agent.configuration-setup-flag" value="true" /> - - <!-- - _______________________________________________________________ - rhq.agent.name - - Explicitly defines what the agent's name is. This will - default to the agent's fully qualified domain name (that is, - the FQDN of the platform where the agent is running). However, - you can set this to any value you want, so long as it is - unique among all other agents. You will need to explicitly set - this if the agent platform's FQDN cannot be reliably determined - at runtime. - - EMBEDDED: this will usually be overridden so the deployer can - provide a unique embedded agent name - --> - <entry key="rhq.agent.name" value="127.0.0.1"/> - - <!-- - _______________________________________________________________ - rhq.agent.server.transport - rhq.agent.server.bind-address - rhq.agent.server.bind-port - rhq.agent.server.transport-params - - The RHQ Server endpoint configuration. - - Note that because this is an XML file, you must specify - "&" in the transport-params value when needing an ampersand - to separate the transport parameters. - - EMBEDDED: these will usually be overridden in the - jboss-service.xml of the embedded agent service - --> - <entry key="rhq.agent.server.transport" value="servlet" /> - <entry key="rhq.agent.server.bind-port" value="7080" /> - <entry key="rhq.agent.server.bind-address" value="127.0.0.1" /> - <entry key="rhq.agent.server.transport-params" value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" /> - - <!-- - _______________________________________________________________ - rhq.agent.server-auto-detection - - If true, the agent will attempt to auto-detect the RHQ Server - coming online and going offline. This is more efficient - than server polling but it requires multicast traffic to be - enabled on your network and also requires the multicast - detector be enabled. - - EMBEDDED: we disable this since we know if the agent is started - the server must be started (since the agent lives inside the - server!) - --> - <entry key="rhq.agent.server-auto-detection" value="false" /> - - <!-- - _______________________________________________________________ - rhq.agent.register-with-server-at-startup - - If true, the agent will attempt to register itself with the - RHQ Server when the agent starts up. If false, the agent will - not automatically register itself at startup; the agent must - be manually registered via some other mechanism (e.g. the - 'register' prompt command). The agent must be registered - at least once in order to notify the RHQ Server about its - existence and to assign the agent a valid security token. - Note that even if this is true, the registration may not happen - immediately if the RHQ Server itself is not up - once the RHQ - Server comes up, the registration attempt will occur. - --> - <entry key="rhq.agent.register-with-server-at-startup" value="true" /> - - <!-- - _______________________________________________________________ - rhq.agent.wait-for-server-at-startup-msecs - - This defines how many milliseconds the agent should wait at - startup for the RHQ Server to be detected. If the RHQ Server - has not started up in the given amount of time, the agent will - continue initializing and expect the server to come up later. - If this is 0, the agent will not wait at all. - - EMBEDDED: we still give an initial pause to let the server - finish starting up before its embedded agent starts talking - to it. - --> - <entry key="rhq.agent.wait-for-server-at-startup-msecs" value="10000" /> - - <!-- - _______________________________________________________________ - rhq.agent.update-plugins-at-startup - - If true, the agent will attempt to update its current set - of plugins to their latest versions at startup. If false, the - agent will not automatically update the plugins; the agent - will use its current plugins. To update the plugins, you must - manually do so via some other mechanism (e.g. the - 'plugins' prompt command). - Note that even if this is true, the update may not happen - immediately if the RHQ Server itself is not up - once the RHQ - Server comes up, the update attempt will occur. - - EMBEDDED: we do not need to update the plugins because the - embedded agent will just share the plugins that the server - serves to other agents. - --> - <entry key="rhq.agent.update-plugins-at-startup" value="false" /> - - <!-- - _______________________________________________________________ - rhq.agent.test-failover-list-at-startup - - If true, the agent will test connectivity to all server - endpoints found in the agent's failover list. This helps - provide a mechanism to quickly detect problems with the - public endpoints configured for all RHQ Servers. - --> - <!-- - <entry key="rhq.agent.test-failover-list-at-startup" value="false" /> - --> - - <!-- - _______________________________________________________________ - rhq.agent.agent-update.enabled - - If true, the agent will be allowed to update itself if it - finds there is a new agent update binary available. - If this feature is not enabled, the agent will never - be allowed to update itself. - - EMBEDDED: we never have to worry about being up-to-date, - the embedded agent will always be the latest - when embedded in its server. - --> - <entry key="rhq.agent.agent-update.enabled" value="false" /> - - <!-- - _______________________________________________________________ - rhq.agent.agent-update.version-url - - If this is defined, it will be the URL the agent uses when it - needs to retrieve information about the latest available - agent update binary. If this is not defined, the agent will - ask its server for the agent update binary version information. - --> - <!-- - <entry key="rhq.agent.agent-update.version-url" value="http://127.0.0.1:7080/agentupdate/version" /> - --> - - <!-- - _______________________________________________________________ - rhq.agent.agent-update.download-url - - If this is defined, it will be the URL the agent uses when it - needs to download the latest available agent update binary. - If this is not defined, the agent will download the agent - update binary from its server. - --> - <!-- - <entry key="rhq.agent.agent-update.download-url" value="http://127.0.0.1:7080/agentupdate/download" /> - --> - - <!-- - _______________________________________________________________ - rhq.agent.primary-server-switchover-check-interval-msecs - - The agent will periodically check to ensure that the server - it is connected to is its primary server (as opposed to one - of its failover servers). This preference defines how many - milliseconds the agent should wait in between these checks. - A side-effect of this check is that the agent will also - download an updated version of its failover list. So if - new servers have been added to the cloud, the agent will - now know about it. - - If this is 0, this check is never performed. You should never - set this to 0 unless your agent will never participate in - an RHQ HA environment. - --> - <entry key="rhq.agent.primary-server-switchover-check-interval-msecs" value="3600000" /> - - <!-- - _______________________________________________________________ - rhq.agent.vm-health-check.interval-msecs - - The agent will periodically check the health of its JVM if - this preference is larger than 0. This check will allow the - agent to attempt to correct possibly fatal problems that are - detected (such as the JVM getting critically low on memory). - The value of this preference, if larger than 0, is the number - of milliseconds the agent should wait in between checks. - - EMBEDDED: disabled - will not check the VM health - --> - <entry key="rhq.agent.vm-health-check.interval-msecs" value="0" /> - - <!-- - _______________________________________________________________ - rhq.agent.vm-health-check.low-heap-mem-threshold - rhq.agent.vm-health-check.low-nonheap-mem-threshold - - The threshold percentage (as a floating decimal) that must be - crossed if the agent's VM health check thread is to consider - the JVM with critically low memory. For example, if - the agent's maximum heap size is 100MB and the heap - threshold is set to 0.90, the agent's VM health check thread - will consider the agent critically low on memory if the agent - is using over 90MB of heap space. - Note that he heap and non-heap memory thresholds are specified - as separate preferences. - --> - <entry key="rhq.agent.vm-health-check.low-heap-mem-threshold" value="0.90" /> - <entry key="rhq.agent.vm-health-check.low-nonheap-mem-threshold" value="0.90" /> - - <!-- - _______________________________________________________________ - rhq.agent.data-directory - - Location of a directory where the agent can write its internal - cache of data. - - EMBEDDED: will be overridden to the server's data directory - --> - <!-- - <entry key="rhq.agent.data-directory" value="data" /> - --> - - <!-- - _______________________________________________________________ - rhq.agent.client.queue-size - - The maximum size of the client command queue - this is the - maximum number of commands that can be queued for sending to - the server. If this is 0, then the queue is unbounded. - WARNING! Setting this to 0 could lead to resources being used - up if for some reason commands keep getting queued but are - not getting sent. - --> - <entry key="rhq.agent.client.queue-size" value="50000" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.max-concurrent - - The maximum number of concurrent commands that can be in the - process of being sent to the server at any one time. - --> - <entry key="rhq.agent.client.max-concurrent" value="5" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.command-timeout-msecs - - The time in milliseconds that the client sender will wait - before aborting a command. This is the amount of time in - milliseconds that the server has in order to process commands. - This value is only the default if a command has not specified - its own timeout. A command can override this by setting its - own timeout in the command's configuration, so this value may - not be used for all commands that are sent. If this value is - less than or equal to 0, there will be no default timeout - and commands will therefore be allowed to take as long as they - need (again, this is the default, individual commands may - override this and set their own timeout). While this infinite - timeout default could conceivably cause a thread to hang - waiting for a rogue command that never finishes, it also reduces - the amount of short-lived threads created by the system - and will increase throughput, dramatically in some cases. - --> - <entry key="rhq.agent.client.command-timeout-msecs" value="600000" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.retry-interval-msecs - - This is the minimum amount of time, in milliseconds, the client - sender will wait before trying to resend a guaranteed command - that previously failed. This is not a guarantee of when - a command is retried - all that can be inferred is that a - command that fails to be sent will not be retried until at - least this amount of time passes. - Note: if the sender is currently waiting in this retry pause - period, the agent will not be able to be shutdown until that - retry period is over. In other words, if the agent is asked - to shutdown, it will wait for those commands waiting in this - retry interval to wake up. This is to help ensure those - commands are not lost. Keep this time period short enough - to make agent shutdowns fairly responsive but long enough - to avoid spinning the process with continuous resending of - commands during periods of RHQ Server downtime. It is - recommended to use auto-detection or server polling in order - to automatically stop the client sender from continuously - trying to retry commands during long periods of RHQ - Server downtime. - --> - <entry key="rhq.agent.client.retry-interval-msecs" value="15000" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.max-retries - - If a guaranteed delivery message is sent, but the agent fails - to connect to the server and deliver the message, it will - always be retried. However, if the error was something other - than a "cannot connect" error, the command will only be retried - this amount of times before the command is dropped. When this - happens, the guaranteed command will never be delivered. This - will normally happen under very odd and rare circumstances. - Also, this setting only effects asynchronous messages that - are sent with guaranteed delivery. This setting has no effect - on other messages. - --> - <entry key="rhq.agent.client.max-retries" value="10" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.server-polling-interval-msecs - - If this value is larger than 0, it indicates the client sender - should periodically poll the RHQ Server to make sure it's still - up or (if it was down) see when it comes back up. The value is - the number of milliseconds to wait in between polls. If the - value is 0 or less, server polling is disabled. Server polling - is less efficient that the agent's auto-detection mechanism, - but server polling does not use multicasting, and thus might - be the only way for the agent to detect the server. - - EMBEDDED: we do not need to poll since we know the server is - always up - --> - <entry key="rhq.agent.client.server-polling-interval-msecs" value="0" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.command-spool-file.name - - This defines the name of the command spool file. This - file must be located in the data directory (if one does not - exist, it will be created). Note that if you do not define - this setting, the default is to not spool commands to disk - and thus implicitly disable guaranteed delivery. - --> - <entry key="rhq.agent.client.command-spool-file.name" value="embedded-agent-command-spool.dat" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.command-spool-file.params - - This defines the parameters for the command spool file. - The spool file is where the agent persists commands that - are flagged for guaranteed delivery and need to be sent. - The format is defined as "max-file-size:purge-percentage". - The first number is the size, in bytes, of the maximum file - size threshold. If the spool file grows larger than this, a - "purge" will be triggered in order to shrink the file. - The second number is the purge percentage which indicates how - large the file is allowed to be after a purge. This is - specified as a percentage of the first parameter - the max - file size threshold. For example, if the max file size is - 100000 (i.e. 100KB) and the purge percentage is 90, then when - the spool file grows larger than 100KB, a purge will be - triggered and the file will be shrunk to no more than - 90% of 100KB - which is 90KB. In effect, 10KB will be freed - to allow room for new commands to be spooled. When this - occurs, unused space is freed first and if that does not - free up enough space, the oldest commands in the spool file - will be sacrificed in order to make room for the newer - commands. - --> - <entry key="rhq.agent.client.command-spool-file.params" value="10000000:75" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.command-spool-file.compressed - - If this flag is true, the commands stored in the spool file - will be compressed. This can potentially save about 30%-40% in - disk space (give or take), however, it slows down the - persistence mechanism considerably. Recommended setting for - this should be true unless something on the agent deployment - box warrants persistence performance over disk-saving . The - performance hit will only appear when unusual conditions occur, - such as shutting down while some guaranteed commands have not - been sent yet or if the RHQ Server is down. It will not affect - the agent under normal conditions (while running with the RHQ - Server up and successfully communicating with the agent). - In those unusual/rare conditions, having performance degradation - may not be as important. - --> - <entry key="rhq.agent.client.command-spool-file.compressed" value="true" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.send-throttling - - If this setting is defined, it will enable send throttling to - occur while sending commands to the server. The format is - defined as "max-commands:quiet-period-milliseconds" - where the maximum commands defines the maximum number - of commands that will be sent before the start of a quiet - period. The quiet period defines the number of milliseconds - in which no commands should be sent. After this duration - expires, commands can again be sent, up to the maximum defined. - Note that send throttling only affects those commands that - are "throttle-able". Some commands are sent as soon as - possible, regardless of the throttling settings. - - This affects sending commands synchronously and asynchronously. - --> - <entry key="rhq.agent.client.send-throttling" value="100:1000" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.queue-throttling - - If this setting is defined, it will enable queue throttling to - occur while sending commands to the server. The format is - defined as "max-commands-per-burst:burst-period-milliseconds" - where the maximum commands per burst defines the maximum number - of commands that can be dequeued within a burst period. The - burst period defines the number of milliseconds in which the - defined maximum number of commands can be dequeued. If more - than the maximum number of commands are queued within this - time period, they will wait until the next burst period starts - before being able to be dequeued. - - This does not affect sending commands synchronously. It only - effects commands queued to be sent asynchronously. - --> - <entry key="rhq.agent.client.queue-throttling" value="200:2000" /> - - <!-- - _______________________________________________________________ - rhq.agent.client.command-preprocessors - - Defines what class or classes will handle preprocessing of all - commands that are sent by the agent. To define multiple - classes, separate them with colon characters (:). - You should never have to change this unless you know what - you are doing. - --> - <entry key="rhq.agent.client.command-preprocessors" value="org.rhq.enterprise.agent.SecurityTokenCommandPreprocessor:org.rhq.enterprise.agent.ExternalizableStrategyCommandPreprocessor" /> - - <!-- - _______________________________________________________________ - rhq.agent.disable-native-system - - The agent has a native system (JNI native libraries) on certain - supported platforms to help the plugin container perform - discovery of native components on those platforms. If the - native libraries are causing errors within the agent or if you - simply do not want to load native components in the agent, - you can disable this native system by setting this preference - setting to true. - --> - <entry key="rhq.agent.disable-native-system" value="false"/> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.directory - - Defines where the plugins can be located. - - EMBEDDED: this will be overridden to point to the - server's location where it stores the plugins that it uses - to send to other agents - --> - <!-- - <entry key="rhq.agent.plugins.directory" value="plugins"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.operation-invocation-timeout-secs - - When an operation is invoked, it will be aborted if it takes - longer than the given amount of seconds. This is just the - default operation invocation timeout - a plugin can override - this default by defining its own timeout in the operation - metadata within its plugin descriptor. - --> - <!-- - <entry key="rhq.agent.plugins.operation-invocation-timeout-secs" value="600"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.operation-invoker.threadpool-size - - When an operation is to be invoked, the execution of the - operation will be performed by threads from a thread pool. - This defines the number of threads within that thread pool, - effectively defining the number of operations that can be - invoked concurrently. - --> - <!-- - <entry key="rhq.agent.plugins.operation-invoker.threadpool-size" value="5"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.server-discovery.initial-delay-secs - - Defines the delay before the first server discovery scan is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.server-discovery.initial-delay-secs" value="10"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.server-discovery.period-secs - - Defines how often a server discovery scan is run. This type - of scan is used to determine changes in the platform - as well as to find new servers that have been added or - old server that have been removed. The value is specified - in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.server-discovery.period-secs" value="900"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.service-discovery.initial-delay-secs - - Defines the delay before the first service discovery scan is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.service-discovery.initial-delay-secs" value="20"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.service-discovery.period-secs - - Defines how often a service discovery scan is run. This type - of scan is used to find new services that have been added or - removed from existing platforms and servers. Technically, - this kind of discovery is used to find any child resource - to an existing parent resource (like a platform or server). - The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.service-discovery.period-secs" value="86400"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.availability-scan.initial-delay-secs - - Defines the delay before the first availability scan is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.availability-scan.initial-delay-secs" value="5"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.availability-scan.period-secs - - Defines how often an availability scan is run. This type - of scan is used to determine what resources are up and running - and what resources have gone down. The value is specified in - seconds. - --> - <!-- - <entry key="rhq.agent.plugins.availability-scan.period-secs" value="300"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.measurement-collection.threadpool-size - - When measurement's are scheduled for collection, the collection - will be performed by threads from a thread pool. This defines - the number of threads within that thread pool, effectively - defining the number of measurements that can be collected - concurrently. - --> - <!-- - <entry key="rhq.agent.plugins.measurement-collection.threadpool-size" value="5"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.measurement-collection.initial-delay-secs - - Defines the delay before the first measurement collection is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.measurement-collection.initial-delay-secs" value="30"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.drift-detection.initial-delay-secs - - Defines the delay before the first drift detection scan is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.drift-detection.initial-delay-secs" value="30"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.drift-detection.period-secs - - Defines how often a drift detection scan is run. This type - of scan is used to determine what, if any, file changes (such - as additions, deletions, modifications) occurred within - specific file system locations that are being monitored. - --> - <!-- - <entry key="rhq.agent.plugins.drift-detection.period-secs" value="60"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.content-discovery.threadpool-size - - When plugins are scheduled to discover content, the discovery - will be performed by threads from a thread pool. This defines - the number of threads within that thread pool. - --> - <!-- - <entry key="rhq.agent.plugins.content-discovery.threadpool-size" value="10"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.content-discovery.initial-delay-secs - - Defines the delay before the first content discovery is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.content-discovery.initial-delay-secs" value="60"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.content-discovery.period-secs - - Defines how often content discoveries are run. The value is - specified in seconds. If this value is 0 or less, content - discovery will be disabled. Content discovery is used to - detect new or changed content that are associated with - resources in inventory. - --> - <!-- - <entry key="rhq.agent.plugins.content-discovery.period-secs" value="30"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.configuration-discovery.initial-delay-secs - - Defines the delay before the first configuration discovery is - run. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.configuration-discovery.initial-delay-secs" value="300"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.configuration-discovery.period-secs - - Defines how often configuration discoveries are run. The value is - specified in seconds. If this value is 0 or less, configuration - discovery will be disabled. Configuration discovery is - performed to detect changes in a managed resource's - configuration settings. - --> - <!-- - <entry key="rhq.agent.plugins.configuration-discovery.period-secs" value="3600"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.event-sender.initial-delay-secs - - Defines the delay before the first event report gets sent - to the server. The value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.event-sender.initial-delay-secs" value="30"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.event-sender.period-secs - - Defines how often event reports get sent to the server. The - value is specified in seconds. - --> - <!-- - <entry key="rhq.agent.plugins.event-sender.period-secs" value="30"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.event-report.max-per-source - - Defines the maximum number of events for any given event source - that can be placed in a single event report that is sent up - to the server. If this number is larger than the max-total - setting, then this setting is ignored. - --> - <!-- - <entry key="rhq.agent.plugins.event-report.max-per-source" value="200"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.event-report.max-total - - Defines the total maximum number of events that can be placed - in a single event report that is sent up to the server. - --> - <!-- - <entry key="rhq.agent.plugins.event-report.max-total" value="400"/> - --> - - <!-- - _______________________________________________________________ - rhq.agent.plugins.disabled - - Defines the names of the plugins that are to be disabled. - This is a comma-separated list of plugin names, where a - plugin name is found in the name attribute in the root XML - element in the plugin descriptor. A disabled plugin will - simply not be loaded in the plugin container. - - By default, all plugins are enabled. If a plugin was marked - as disabled by the server, the agent will not download it and - will not load it, regardless of the value of this preference. - If a plugin is enabled on the server, this - preference will override that enable setting (in other words, - an agent is able to disable a plugin, effectively overriding - the server setting, by placing the plugin name in this - preference). If the agent already has a plugin jar in - its local plugins directory, but that plugin is disabled - via this preference, that local plugin jar file will be - deleted and the plugin will not be loaded. - --> - <!-- - <entry key="rhq.agent.plugins.disabled" value=""/> - --> - - <!-- - _______________________________________________________________ - rhq.communications.configuration-schema-version - - Defines what version of the agent configuration schema this - file conforms to. This is the schema for the - rhq.communications preferences. - --> - <entry key="rhq.communications.configuration-schema-version" value="1" /> - - <!-- - _______________________________________________________________ - rhq.communications.service-container.mbean-server-name - - Name of the MBean Server that houses the communications MBean - services. This is actually the default domain name of the - MBean Server and if an MBean Server has already been registered - with this name, it will be used to house the communications - services. If an MBean Server has not yet been registered with - this name as its default domain, one will be created. Typically - this can be left undefined which means the fallback MBeanServer - to be used is the built-in JVM platform MBeanServer. - --> - <entry key="rhq.communications.service-container.mbean-server-name" value="embedded-agent" /> - - <!-- - _______________________________________________________________ - rhq.communications.data-directory - - The location where the communication services write internal - data files. If not defined, the data directory will be the - same as the agent's. - --> - <!-- - <entry key="rhq.communications.data-directory" value="data" /> - --> - - <!-- - _______________________________________________________________ - rhq.communications.global-concurrency-limit - - The maximum number of incoming commands that are allowed to be - received concurrently. Zero or less indicates there is to - be no limit and the agent can accept as many incoming - commands as possible. By default, there is no limit - and you typically did not have to change this from its - default. - --> - <entry key="rhq.communications.global-concurrency-limit" value="-1" /> - - <!-- - _______________________________________________________________ - rhq.communications.multicast-detector.enabled - rhq.communications.multicast-detector.multicast-address - rhq.communications.multicast-detector.bind-address - rhq.communications.multicast-detector.port - rhq.communications.multicast-detector.default-time-delay - rhq.communications.multicast-detector.heartbeat-time-delay - - The multicast detector configuration. This is the service that - listens for new remote servers coming on and going offline and - is required if you want server auto-detection. If you do not - have server auto-detection enabled or your network will not - support multicast traffic, you should disable the multicast - detector. - - The multicast-address is used to broadcast detection messages. - To be more specific, it is the IP address of the - multicast group the detector will join. The bind-address - is the IP that is bound by the network interface. - - The detector will send heartbeat messages every X milliseconds - (this is the heartbeat-time-delay). If external servers' - detectors do not send their heartbeat messages within the - default-time-delay, our detector will assume that external - server has gone down. These settings affect the timeliness - of our auto-detection mechanism. - - EMBEDDED: since the agent is running inside the server, no need - to try to auto-discover it since, if the agent is up, it knows - the server is, too. - --> - <entry key="rhq.communications.multicast-detector.enabled" value="false" /> - <entry key="rhq.communications.multicast-detector.multicast-address" value="224.16.16.16" /> - <entry key="rhq.communications.multicast-detector.bind-address" value="0.0.0.0" /> - <entry key="rhq.communications.multicast-detector.port" value="16162" /> - <entry key="rhq.communications.multicast-detector.default-time-delay" value="5000" /> - <entry key="rhq.communications.multicast-detector.heartbeat-time-delay" value="1000" /> - - <!-- - _______________________________________________________________ - rhq.communications.connector.rhqtype - rhq.communications.connector.transport - rhq.communications.connector.bind-port - rhq.communications.connector.bind-address - rhq.communications.connector.transport-params - rhq.communications.connector.lease-period - - The agent's connector configuration. This is the service that - listens for incoming client requests and passes them to the - appropriate server-side components for processing. See the - JBoss/Remoting documentation for a full list of options - that can be specified. Note that because this is an XML file, - you must specify "&" in the transport-params value - when needing an ampersand to separate the parameters. - - EMBEDDED: the bind address will be overridden to be the - one used by the server. The bind port is normally overridden - in the jboss-service.xml also. - --> - <entry key="rhq.communications.connector.rhqtype" value="agent" /> - <entry key="rhq.communications.connector.transport" value="socket" /> - <!-- - <entry key="rhq.communications.connector.bind-address" value="127.0.0.1" /> - <entry key="rhq.communications.connector.bind-port" value="26163" /> - --> - <!-- - <entry key="rhq.communications.connector.transport-params" value="clientConnectAddress=127.0.0.1&clientConnectPort=16163&numAcceptThreads=3&maxPoolSize=303&clientMaxPoolSize=304&socketTimeout=60000&enableTcpNoDelay=true&backlog=200" /> - <entry key="rhq.communications.connector.lease-period" value="5000" /> - --> - - <!-- - _______________________________________________________________ - rhq.communications.connector.security.secure-socket-protocol - rhq.communications.connector.security.keystore.file - rhq.communications.connector.security.keystore.algorithm - rhq.communications.connector.security.keystore.type - rhq.communications.connector.security.keystore.password - rhq.communications.connector.security.keystore.key-password - rhq.communications.connector.security.keystore.alias - rhq.communications.connector.security.truststore.file - rhq.communications.connector.security.truststore.algorithm - rhq.communications.connector.security.truststore.type - rhq.communications.connector.security.truststore.password - rhq.communications.connector.security.client-auth-mode - - rhq.agent.client.security.secure-socket-protocol - rhq.agent.client.security.keystore.file - rhq.agent.client.security.keystore.algorithm - rhq.agent.client.security.keystore.type - rhq.agent.client.security.keystore.password - rhq.agent.client.security.keystore.key-password - rhq.agent.client.security.keystore.alias - rhq.agent.client.security.truststore.file - rhq.agent.client.security.truststore.algorithm - rhq.agent.client.security.truststore.type - rhq.agent.client.security.truststore.password - rhq.agent.client.security.server-auth-mode-enabled - - These are the settings that are used if SSL is to be used for - either the server or client communications. These can be left - unset since the defaults will normally suffice. These - properties are here just in case some use case occurs that - require one or more of these settings to be customized. - - Note that if client-auth-mode is specified, it must be one of: - "none", "want", "need". - - EMBEDDED: the agent is in the same VM as the server so there - is no need for transport security since traffic is never - actually routed outside of the VM. - --> - <!-- - <entry key="rhq.communications.connector.security.secure-socket-protocol" value="TLS" /> - <entry key="rhq.communications.connector.security.keystore.file" value="data/keystore.dat" /> - <entry key="rhq.communications.connector.security.keystore.algorithm" value="SunX509" /> - <entry key="rhq.communications.connector.security.keystore.type" value="JKS" /> - <entry key="rhq.communications.connector.security.keystore.password" value="rhqpwd" /> - <entry key="rhq.communications.connector.security.keystore.key-password" value="rhqpwd" /> - <entry key="rhq.communications.connector.security.keystore.alias" value="rhq" /> - <entry key="rhq.communications.connector.security.truststore.file" value="data/truststore.dat" /> - <entry key="rhq.communications.connector.security.truststore.algorithm" value="SunX509" /> - <entry key="rhq.communications.connector.security.truststore.type" value="JKS" /> - <entry key="rhq.communications.connector.security.truststore.password" value="" /> - <entry key="rhq.communications.connector.security.client-auth-mode" value="none" /> - - <entry key="rhq.agent.client.security.secure-socket-protocol" value="TLS" /> - <entry key="rhq.agent.client.security.keystore.file" value="data/keystore.dat" /> - <entry key="rhq.agent.client.security.keystore.algorithm" value="SunX509" /> - <entry key="rhq.agent.client.security.keystore.type" value="JKS" /> - <entry key="rhq.agent.client.security.keystore.password" value="rhqpwd" /> - <entry key="rhq.agent.client.security.keystore.key-password" value="rhqpwd" /> - <entry key="rhq.agent.client.security.keystore.alias" value="rhq" /> - <entry key="rhq.agent.client.security.truststore.file" value="data/truststore.dat" /> - <entry key="rhq.agent.client.security.truststore.algorithm" value="SunX509" /> - <entry key="rhq.agent.client.security.truststore.type" value="JKS" /> - <entry key="rhq.agent.client.security.truststore.password" value="" /> - <entry key="rhq.agent.client.security.server-auth-mode-enabled" value="false" /> - --> - - <!-- - _______________________________________________________________ - rhq.communications.remote-stream-max-idle-time-msecs - - The maximum amount of milliseconds a remoted stream - is allowed to be idle before it is automatically closed and - removed from the server. This means that a client must - attempt to access the remoted stream every X milliseconds - (where X is the value of this setting) or that stream will no - longer be available. Note that this does not mean a client - must read or write the entire stream in this amount of time, - it only means a client must make a request on the stream every - X milliseconds (be it to read or write one byte, see how many - bytes are available to be read, etc). - --> - <entry key="rhq.communications.remote-stream-max-idle-time-msecs" value="300000" /> - - <!-- - _______________________________________________________________ - rhq.communications.command-service-directory.allow-dynamic-discovery - - Flag to allow new command services to be added to the command - services directory during runtime. If this is false, only - those services defined in the - rhq.communications.command-services preference will be available - during the lifetime of the command service directory. - --> - <entry key="rhq.communications.command-service-directory.allow-dynamic-discovery" value="true" /> - - <!-- - _______________________________________________________________ - rhq.communications.command-services - - Command Services that are to be added immediately at startup. - --> - <entry key="rhq.communications.command-services" value="org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService, org.rhq.enterprise.communications.command.impl.identify.server.IdentifyCommandService" /> - - <!-- - _______________________________________________________________ - rhq.communications.remote-pojos - - Objects that are to be created and their remote interfaces - deployed immediately at startup. The format of the value is - a comma separated list of implementation/interface names: - class.to.instantiate.via.noarg.constructor:interface.to.expose - --> - <entry key="rhq.communications.remote-pojos" value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping" /> - - <!-- - _______________________________________________________________ - rhq.agent.do-not-override-prefs-with-sysprops - - EMBEDDED: To avoid having the embedded agent pick up - configuration settings that belong to the server in which it is - embedded, we want to disable the system property overlay - feature of the agent configuration. - --> - <entry key="rhq.agent.do-not-override-prefs-with-sysprops" value="true" /> - - </map> - </node> - </node> - </root> -</preferences> \ No newline at end of file diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml new file mode 100644 index 0000000..afbe075 --- /dev/null +++ b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"> + <deployment> + <resources> + <resource-root path="lib/rhq-enterprise-agent-${project.version}.jar" /> + <resource-root path="lib/rhq-enterprise-comm-${project.version}.jar" /> + <resource-root path="lib/rhq-core-comm-api-${project.version}.jar" /> + <resource-root path="lib/rhq-core-util-${project.version}.jar" /> + <resource-root path="lib/i18nlog-${i18nlog.version}.jar" /> + </resources> + </deployment> +</jboss-deployment-structure> \ No newline at end of file diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml index d014713..b8f3359 100644 --- a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml +++ b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- $Id: jboss-service.xml,v 1.3.2.12 2006/03/10 19:26:40 asaldhana Exp $ -->
-<server> +<server xmlns="urn:jboss:service:7.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
<mbean code="org.rhq.enterprise.server.agent.EmbeddedAgentBootstrapService" name="rhq:service=EmbeddedAgentBootstrap"> @@ -9,129 +10,11 @@ <attribute name="AgentEnabled">${rhq.server.embedded-agent.enabled:false}</attribute> <attribute name="ResetConfiguration">${rhq.server.embedded-agent.reset-configuration:false}</attribute> <attribute name="PreferencesNodeName">${rhq.server.embedded-agent.name:}</attribute> - - <attribute name="ConfigurationOverrides" serialDataType="jbxb"> - <java:properties xmlns:java="urn:jboss:java-properties" - xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" - xs:schemaLocation="urn:jboss:java-properties resource:java-properties_1_0.xsd"> + <attribute name="EmbeddedAgentDirectory">${jboss.server.base.dir}/deployments/rhq-agent.sar/META-INF/embedded-agent</attribute> + <attribute name="ConfigurationOverridesFile">embedded-agent-configuration-overrides.properties</attribute>
- <!-- name of the embedded agent --> - - java:property - java:keyrhq.agent.name</java:key> - java:value${rhq.server.embedded-agent.name:}</java:value> - </java:property> - - <!-- the agent's server will point to the location of the server where it is embedded --> - - java:property - java:keyrhq.agent.server.transport</java:key> - java:value${rhq.communications.connector.transport:servlet}</java:value> - </java:property> - java:property - java:keyrhq.agent.server.bind-address</java:key> - java:value${rhq.communications.connector.bind-address}</java:value> - </java:property> - java:property - java:keyrhq.agent.server.bind-port</java:key> - java:value${rhq.communications.connector.bind-port}</java:value> - </java:property> - java:property - java:keyrhq.agent.server.transport-params</java:key> - java:value${rhq.communications.connector.transport-params:/jboss-remoting-servlet-invoker/ServerInvokerServlet}</java:value> - </java:property> - - <!-- the binding address/port for the agent's server socket --> - - java:property - java:keyrhq.communications.connector.bind-address</java:key> - java:value${rhq.communications.connector.bind-address}</java:value> - </java:property> - java:property - java:keyrhq.communications.connector.bind-port</java:key> - java:value${rhq.server.embedded-agent.bind-port:26163}</java:value> - </java:property> - - <!-- location where data files can be stored --> - - java:property - java:keyrhq.agent.data-directory</java:key> - java:value${jboss.server.data.dir}/embedded-agent</java:value> - </java:property> - - <!-- location of the plugins --> - - java:property - java:keyrhq.agent.plugins.directory</java:key> - java:value${jboss.server.home.dir}/deploy/rhq.ear/rhq-downloads/rhq-plugins</java:value> - </java:property> - - <!-- Client-side SSL Security Configuration (for sending messages to the server) --> - - java:property - java:keyrhq.agent.client.security.secure-socket-protocol</java:key> - java:value${rhq.communications.connector.security.secure-socket-protocol:TLS}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.keystore.file</java:key> - java:value${rhq.communications.connector.security.keystore.file}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.keystore.algorithm</java:key> - java:value${rhq.communications.connector.security.keystore.algorithm:SunX509}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.keystore.type</java:key> - java:value${rhq.communications.connector.security.keystore.type:JKS}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.keystore.password</java:key> - java:value${rhq.communications.connector.security.keystore.password:rhqpwd}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.keystore.key-password</java:key> - java:value${rhq.communications.connector.security.keystore.key-password:rhqpwd}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.keystore.alias</java:key> - java:value${rhq.communications.connector.security.keystore.alias:rhq}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.truststore.file</java:key> - java:value${rhq.communications.connector.security.truststore.file}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.truststore.algorithm</java:key> - java:value${rhq.communications.connector.security.truststore.algorithm:SunX509}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.truststore.type</java:key> - java:value${rhq.communications.connector.security.truststore.type:JKS}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.truststore.password</java:key> - java:value${rhq.communications.connector.security.truststore.password}</java:value> - </java:property> - java:property - java:keyrhq.agent.client.security.server-auth-mode-enabled</java:key> - java:value${rhq.server.client.security.server-auth-mode-enabled:false}</java:value> - </java:property> - - <!-- indicate if you do not want the native system to be used by the embedded agent --> - - java:property - java:keyrhq.agent.disable-native-system</java:key> - java:value${rhq.server.embedded-agent.disable-native-system:false}</java:value> - </java:property> - - </java:properties> - </attribute> - - <attribute name="EmbeddedAgentDirectory">${jboss.server.home.dir}/deploy/rhq-agent.sar/META-INF/embedded-agent</attribute> - <!-- comma-separated arguments passed to agent main method; do not pass the -c or -p arguments --> - <attribute name="AgentArguments">--daemon,--output=${jboss.home.dir}/../logs/embedded-agent.out</attribute> - + <attribute name="AgentArguments">--daemon,--output=${jboss.server.log.dir}/embedded-agent.out</attribute> </mbean>
</server> diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties b/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties new file mode 100644 index 0000000..3bcc7d7 --- /dev/null +++ b/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties @@ -0,0 +1,29 @@ +# name of the embedded agent +rhq.agent.name=${rhq.server.embedded-agent.name:} +# the agent's server will point to the location of the server where it is embedded +rhq.agent.server.transport=${rhq.communications.connector.transport:servlet} +rhq.agent.server.bind-address=${rhq.communications.connector.bind-address} +rhq.agent.server.bind-port=${rhq.communications.connector.bind-port} +rhq.agent.server.transport-params=${rhq.communications.connector.transport-params:/jboss-remoting-servlet-invoker/ServerInvokerServlet} +# the binding address/port for the agent's server socket +rhq.communications.connector.bind-address=${rhq.communications.connector.bind-address} +rhq.communications.connector.bind-port=${rhq.server.embedded-agent.bind-port:26163} +# location where data files can be stored +rhq.agent.data-directory=${jboss.server.data.dir}/embedded-agent +# location of the plugins +rhq.agent.plugins.directory=${jboss.server.base.dir}/deployments/rhq.ear/rhq-downloads/rhq-plugins +# Client-side SSL Security Configuration (for sending messages to the server) +rhq.agent.client.security.secure-socket-protocol=${rhq.communications.connector.security.secure-socket-protocol:TLS} +rhq.agent.client.security.keystore.file=${rhq.communications.connector.security.keystore.file} +rhq.agent.client.security.keystore.algorithm=${rhq.communications.connector.security.keystore.algorithm:SunX509} +rhq.agent.client.security.keystore.type=${rhq.communications.connector.security.keystore.type:JKS} +rhq.agent.client.security.keystore.password=${rhq.communications.connector.security.keystore.password:rhqpwd} +rhq.agent.client.security.keystore.key-password=${rhq.communications.connector.security.keystore.key-password:rhqpwd} +rhq.agent.client.security.keystore.alias=${rhq.communications.connector.security.keystore.alias:rhq} +rhq.agent.client.security.truststore.file=${rhq.communications.connector.security.truststore.file} +rhq.agent.client.security.truststore.algorithm=${rhq.communications.connector.security.truststore.algorithm:SunX509} +rhq.agent.client.security.truststore.type=${rhq.communications.connector.security.truststore.type:JKS} +rhq.agent.client.security.truststore.password=${rhq.communications.connector.security.truststore.password} +rhq.agent.client.security.server-auth-mode-enabled=${rhq.server.client.security.server-auth-mode-enabled:false} +# indicate if you do not want the native system to be used by the embedded agent +rhq.agent.disable-native-system=${rhq.server.embedded-agent.disable-native-system:false} diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml new file mode 100644 index 0000000..a9a8b77 --- /dev/null +++ b/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml @@ -0,0 +1,1062 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'> + +<!-- +============================================================================== +Embedded RHQ Agent Configuration +============================================================================== +--> + +<preferences EXTERNAL_XML_VERSION="1.0"> + <root type="user"> + <map /> + <node name="rhq-agent"> + <map /> + <node name="${rhq.server.embedded-agent.preferences-node}"> + <map> + <!-- + _______________________________________________________________ + rhq.agent.configuration-schema-version + + Defines what version of the agent configuration schema this + file conforms to. This is the schema for the rhq.agent + preferences. + --> + <entry key="rhq.agent.configuration-schema-version" value="6" /> + + <!-- + _______________________________________________________________ + rhq.agent.configuration-setup-flag + + If true, the agent will assume it is fully configured and + will not ask setup questions when it starts up. If false, + the agent assumes the configuration is not complete and + will ask a series of setup questions to the user in order + to be fully configured. + + If you write your own custom agent configuration file, you + will probably want to set this flag to true since you + probably will set all of your configuration right in the + configuration file itself. However, you may wish to + distribute agent configuration files with only a subset + of configuration preferences set and rely on each agent's + startup setup mechanism to finish its configuration - in this + case, you'll want to leave this as false. + + EMBEDDED: this is true - we ensure the agent is fully + configured; we have to since the agent has no console + interface and must start in daemon mode + --> + <entry key="rhq.agent.configuration-setup-flag" value="true" /> + + <!-- + _______________________________________________________________ + rhq.agent.name + + Explicitly defines what the agent's name is. This will + default to the agent's fully qualified domain name (that is, + the FQDN of the platform where the agent is running). However, + you can set this to any value you want, so long as it is + unique among all other agents. You will need to explicitly set + this if the agent platform's FQDN cannot be reliably determined + at runtime. + + EMBEDDED: this will usually be overridden so the deployer can + provide a unique embedded agent name + --> + <entry key="rhq.agent.name" value="127.0.0.1"/> + + <!-- + _______________________________________________________________ + rhq.agent.server.transport + rhq.agent.server.bind-address + rhq.agent.server.bind-port + rhq.agent.server.transport-params + + The RHQ Server endpoint configuration. + + Note that because this is an XML file, you must specify + "&" in the transport-params value when needing an ampersand + to separate the transport parameters. + + EMBEDDED: these will usually be overridden in the + jboss-service.xml of the embedded agent service + --> + <entry key="rhq.agent.server.transport" value="servlet" /> + <entry key="rhq.agent.server.bind-port" value="7080" /> + <entry key="rhq.agent.server.bind-address" value="127.0.0.1" /> + <entry key="rhq.agent.server.transport-params" value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" /> + + <!-- + _______________________________________________________________ + rhq.agent.server-auto-detection + + If true, the agent will attempt to auto-detect the RHQ Server + coming online and going offline. This is more efficient + than server polling but it requires multicast traffic to be + enabled on your network and also requires the multicast + detector be enabled. + + EMBEDDED: we disable this since we know if the agent is started + the server must be started (since the agent lives inside the + server!) + --> + <entry key="rhq.agent.server-auto-detection" value="false" /> + + <!-- + _______________________________________________________________ + rhq.agent.register-with-server-at-startup + + If true, the agent will attempt to register itself with the + RHQ Server when the agent starts up. If false, the agent will + not automatically register itself at startup; the agent must + be manually registered via some other mechanism (e.g. the + 'register' prompt command). The agent must be registered + at least once in order to notify the RHQ Server about its + existence and to assign the agent a valid security token. + Note that even if this is true, the registration may not happen + immediately if the RHQ Server itself is not up - once the RHQ + Server comes up, the registration attempt will occur. + --> + <entry key="rhq.agent.register-with-server-at-startup" value="true" /> + + <!-- + _______________________________________________________________ + rhq.agent.wait-for-server-at-startup-msecs + + This defines how many milliseconds the agent should wait at + startup for the RHQ Server to be detected. If the RHQ Server + has not started up in the given amount of time, the agent will + continue initializing and expect the server to come up later. + If this is 0, the agent will not wait at all. + + EMBEDDED: we still give an initial pause to let the server + finish starting up before its embedded agent starts talking + to it. + --> + <entry key="rhq.agent.wait-for-server-at-startup-msecs" value="10000" /> + + <!-- + _______________________________________________________________ + rhq.agent.update-plugins-at-startup + + If true, the agent will attempt to update its current set + of plugins to their latest versions at startup. If false, the + agent will not automatically update the plugins; the agent + will use its current plugins. To update the plugins, you must + manually do so via some other mechanism (e.g. the + 'plugins' prompt command). + Note that even if this is true, the update may not happen + immediately if the RHQ Server itself is not up - once the RHQ + Server comes up, the update attempt will occur. + + EMBEDDED: we do not need to update the plugins because the + embedded agent will just share the plugins that the server + serves to other agents. + --> + <entry key="rhq.agent.update-plugins-at-startup" value="false" /> + + <!-- + _______________________________________________________________ + rhq.agent.test-failover-list-at-startup + + If true, the agent will test connectivity to all server + endpoints found in the agent's failover list. This helps + provide a mechanism to quickly detect problems with the + public endpoints configured for all RHQ Servers. + --> + <!-- + <entry key="rhq.agent.test-failover-list-at-startup" value="false" /> + --> + + <!-- + _______________________________________________________________ + rhq.agent.agent-update.enabled + + If true, the agent will be allowed to update itself if it + finds there is a new agent update binary available. + If this feature is not enabled, the agent will never + be allowed to update itself. + + EMBEDDED: we never have to worry about being up-to-date, + the embedded agent will always be the latest + when embedded in its server. + --> + <entry key="rhq.agent.agent-update.enabled" value="false" /> + + <!-- + _______________________________________________________________ + rhq.agent.agent-update.version-url + + If this is defined, it will be the URL the agent uses when it + needs to retrieve information about the latest available + agent update binary. If this is not defined, the agent will + ask its server for the agent update binary version information. + --> + <!-- + <entry key="rhq.agent.agent-update.version-url" value="http://127.0.0.1:7080/agentupdate/version" /> + --> + + <!-- + _______________________________________________________________ + rhq.agent.agent-update.download-url + + If this is defined, it will be the URL the agent uses when it + needs to download the latest available agent update binary. + If this is not defined, the agent will download the agent + update binary from its server. + --> + <!-- + <entry key="rhq.agent.agent-update.download-url" value="http://127.0.0.1:7080/agentupdate/download" /> + --> + + <!-- + _______________________________________________________________ + rhq.agent.primary-server-switchover-check-interval-msecs + + The agent will periodically check to ensure that the server + it is connected to is its primary server (as opposed to one + of its failover servers). This preference defines how many + milliseconds the agent should wait in between these checks. + A side-effect of this check is that the agent will also + download an updated version of its failover list. So if + new servers have been added to the cloud, the agent will + now know about it. + + If this is 0, this check is never performed. You should never + set this to 0 unless your agent will never participate in + an RHQ HA environment. + --> + <entry key="rhq.agent.primary-server-switchover-check-interval-msecs" value="3600000" /> + + <!-- + _______________________________________________________________ + rhq.agent.vm-health-check.interval-msecs + + The agent will periodically check the health of its JVM if + this preference is larger than 0. This check will allow the + agent to attempt to correct possibly fatal problems that are + detected (such as the JVM getting critically low on memory). + The value of this preference, if larger than 0, is the number + of milliseconds the agent should wait in between checks. + + EMBEDDED: disabled - will not check the VM health + --> + <entry key="rhq.agent.vm-health-check.interval-msecs" value="0" /> + + <!-- + _______________________________________________________________ + rhq.agent.vm-health-check.low-heap-mem-threshold + rhq.agent.vm-health-check.low-nonheap-mem-threshold + + The threshold percentage (as a floating decimal) that must be + crossed if the agent's VM health check thread is to consider + the JVM with critically low memory. For example, if + the agent's maximum heap size is 100MB and the heap + threshold is set to 0.90, the agent's VM health check thread + will consider the agent critically low on memory if the agent + is using over 90MB of heap space. + Note that he heap and non-heap memory thresholds are specified + as separate preferences. + --> + <entry key="rhq.agent.vm-health-check.low-heap-mem-threshold" value="0.90" /> + <entry key="rhq.agent.vm-health-check.low-nonheap-mem-threshold" value="0.90" /> + + <!-- + _______________________________________________________________ + rhq.agent.data-directory + + Location of a directory where the agent can write its internal + cache of data. + + EMBEDDED: will be overridden to the server's data directory + --> + <!-- + <entry key="rhq.agent.data-directory" value="data" /> + --> + + <!-- + _______________________________________________________________ + rhq.agent.client.queue-size + + The maximum size of the client command queue - this is the + maximum number of commands that can be queued for sending to + the server. If this is 0, then the queue is unbounded. + WARNING! Setting this to 0 could lead to resources being used + up if for some reason commands keep getting queued but are + not getting sent. + --> + <entry key="rhq.agent.client.queue-size" value="50000" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.max-concurrent + + The maximum number of concurrent commands that can be in the + process of being sent to the server at any one time. + --> + <entry key="rhq.agent.client.max-concurrent" value="5" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.command-timeout-msecs + + The time in milliseconds that the client sender will wait + before aborting a command. This is the amount of time in + milliseconds that the server has in order to process commands. + This value is only the default if a command has not specified + its own timeout. A command can override this by setting its + own timeout in the command's configuration, so this value may + not be used for all commands that are sent. If this value is + less than or equal to 0, there will be no default timeout + and commands will therefore be allowed to take as long as they + need (again, this is the default, individual commands may + override this and set their own timeout). While this infinite + timeout default could conceivably cause a thread to hang + waiting for a rogue command that never finishes, it also reduces + the amount of short-lived threads created by the system + and will increase throughput, dramatically in some cases. + --> + <entry key="rhq.agent.client.command-timeout-msecs" value="600000" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.retry-interval-msecs + + This is the minimum amount of time, in milliseconds, the client + sender will wait before trying to resend a guaranteed command + that previously failed. This is not a guarantee of when + a command is retried - all that can be inferred is that a + command that fails to be sent will not be retried until at + least this amount of time passes. + Note: if the sender is currently waiting in this retry pause + period, the agent will not be able to be shutdown until that + retry period is over. In other words, if the agent is asked + to shutdown, it will wait for those commands waiting in this + retry interval to wake up. This is to help ensure those + commands are not lost. Keep this time period short enough + to make agent shutdowns fairly responsive but long enough + to avoid spinning the process with continuous resending of + commands during periods of RHQ Server downtime. It is + recommended to use auto-detection or server polling in order + to automatically stop the client sender from continuously + trying to retry commands during long periods of RHQ + Server downtime. + --> + <entry key="rhq.agent.client.retry-interval-msecs" value="15000" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.max-retries + + If a guaranteed delivery message is sent, but the agent fails + to connect to the server and deliver the message, it will + always be retried. However, if the error was something other + than a "cannot connect" error, the command will only be retried + this amount of times before the command is dropped. When this + happens, the guaranteed command will never be delivered. This + will normally happen under very odd and rare circumstances. + Also, this setting only effects asynchronous messages that + are sent with guaranteed delivery. This setting has no effect + on other messages. + --> + <entry key="rhq.agent.client.max-retries" value="10" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.server-polling-interval-msecs + + If this value is larger than 0, it indicates the client sender + should periodically poll the RHQ Server to make sure it's still + up or (if it was down) see when it comes back up. The value is + the number of milliseconds to wait in between polls. If the + value is 0 or less, server polling is disabled. Server polling + is less efficient that the agent's auto-detection mechanism, + but server polling does not use multicasting, and thus might + be the only way for the agent to detect the server. + + EMBEDDED: we do not need to poll since we know the server is + always up + --> + <entry key="rhq.agent.client.server-polling-interval-msecs" value="0" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.command-spool-file.name + + This defines the name of the command spool file. This + file must be located in the data directory (if one does not + exist, it will be created). Note that if you do not define + this setting, the default is to not spool commands to disk + and thus implicitly disable guaranteed delivery. + --> + <entry key="rhq.agent.client.command-spool-file.name" value="embedded-agent-command-spool.dat" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.command-spool-file.params + + This defines the parameters for the command spool file. + The spool file is where the agent persists commands that + are flagged for guaranteed delivery and need to be sent. + The format is defined as "max-file-size:purge-percentage". + The first number is the size, in bytes, of the maximum file + size threshold. If the spool file grows larger than this, a + "purge" will be triggered in order to shrink the file. + The second number is the purge percentage which indicates how + large the file is allowed to be after a purge. This is + specified as a percentage of the first parameter - the max + file size threshold. For example, if the max file size is + 100000 (i.e. 100KB) and the purge percentage is 90, then when + the spool file grows larger than 100KB, a purge will be + triggered and the file will be shrunk to no more than + 90% of 100KB - which is 90KB. In effect, 10KB will be freed + to allow room for new commands to be spooled. When this + occurs, unused space is freed first and if that does not + free up enough space, the oldest commands in the spool file + will be sacrificed in order to make room for the newer + commands. + --> + <entry key="rhq.agent.client.command-spool-file.params" value="10000000:75" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.command-spool-file.compressed + + If this flag is true, the commands stored in the spool file + will be compressed. This can potentially save about 30%-40% in + disk space (give or take), however, it slows down the + persistence mechanism considerably. Recommended setting for + this should be true unless something on the agent deployment + box warrants persistence performance over disk-saving . The + performance hit will only appear when unusual conditions occur, + such as shutting down while some guaranteed commands have not + been sent yet or if the RHQ Server is down. It will not affect + the agent under normal conditions (while running with the RHQ + Server up and successfully communicating with the agent). + In those unusual/rare conditions, having performance degradation + may not be as important. + --> + <entry key="rhq.agent.client.command-spool-file.compressed" value="true" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.send-throttling + + If this setting is defined, it will enable send throttling to + occur while sending commands to the server. The format is + defined as "max-commands:quiet-period-milliseconds" + where the maximum commands defines the maximum number + of commands that will be sent before the start of a quiet + period. The quiet period defines the number of milliseconds + in which no commands should be sent. After this duration + expires, commands can again be sent, up to the maximum defined. + Note that send throttling only affects those commands that + are "throttle-able". Some commands are sent as soon as + possible, regardless of the throttling settings. + + This affects sending commands synchronously and asynchronously. + --> + <entry key="rhq.agent.client.send-throttling" value="100:1000" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.queue-throttling + + If this setting is defined, it will enable queue throttling to + occur while sending commands to the server. The format is + defined as "max-commands-per-burst:burst-period-milliseconds" + where the maximum commands per burst defines the maximum number + of commands that can be dequeued within a burst period. The + burst period defines the number of milliseconds in which the + defined maximum number of commands can be dequeued. If more + than the maximum number of commands are queued within this + time period, they will wait until the next burst period starts + before being able to be dequeued. + + This does not affect sending commands synchronously. It only + effects commands queued to be sent asynchronously. + --> + <entry key="rhq.agent.client.queue-throttling" value="200:2000" /> + + <!-- + _______________________________________________________________ + rhq.agent.client.command-preprocessors + + Defines what class or classes will handle preprocessing of all + commands that are sent by the agent. To define multiple + classes, separate them with colon characters (:). + You should never have to change this unless you know what + you are doing. + --> + <entry key="rhq.agent.client.command-preprocessors" value="org.rhq.enterprise.agent.SecurityTokenCommandPreprocessor:org.rhq.enterprise.agent.ExternalizableStrategyCommandPreprocessor" /> + + <!-- + _______________________________________________________________ + rhq.agent.disable-native-system + + The agent has a native system (JNI native libraries) on certain + supported platforms to help the plugin container perform + discovery of native components on those platforms. If the + native libraries are causing errors within the agent or if you + simply do not want to load native components in the agent, + you can disable this native system by setting this preference + setting to true. + --> + <entry key="rhq.agent.disable-native-system" value="false"/> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.directory + + Defines where the plugins can be located. + + EMBEDDED: this will be overridden to point to the + server's location where it stores the plugins that it uses + to send to other agents + --> + <!-- + <entry key="rhq.agent.plugins.directory" value="plugins"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.operation-invocation-timeout-secs + + When an operation is invoked, it will be aborted if it takes + longer than the given amount of seconds. This is just the + default operation invocation timeout - a plugin can override + this default by defining its own timeout in the operation + metadata within its plugin descriptor. + --> + <!-- + <entry key="rhq.agent.plugins.operation-invocation-timeout-secs" value="600"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.operation-invoker.threadpool-size + + When an operation is to be invoked, the execution of the + operation will be performed by threads from a thread pool. + This defines the number of threads within that thread pool, + effectively defining the number of operations that can be + invoked concurrently. + --> + <!-- + <entry key="rhq.agent.plugins.operation-invoker.threadpool-size" value="5"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.server-discovery.initial-delay-secs + + Defines the delay before the first server discovery scan is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.server-discovery.initial-delay-secs" value="10"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.server-discovery.period-secs + + Defines how often a server discovery scan is run. This type + of scan is used to determine changes in the platform + as well as to find new servers that have been added or + old server that have been removed. The value is specified + in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.server-discovery.period-secs" value="900"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.service-discovery.initial-delay-secs + + Defines the delay before the first service discovery scan is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.service-discovery.initial-delay-secs" value="20"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.service-discovery.period-secs + + Defines how often a service discovery scan is run. This type + of scan is used to find new services that have been added or + removed from existing platforms and servers. Technically, + this kind of discovery is used to find any child resource + to an existing parent resource (like a platform or server). + The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.service-discovery.period-secs" value="86400"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.availability-scan.initial-delay-secs + + Defines the delay before the first availability scan is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.availability-scan.initial-delay-secs" value="5"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.availability-scan.period-secs + + Defines how often an availability scan is run. This type + of scan is used to determine what resources are up and running + and what resources have gone down. The value is specified in + seconds. + --> + <!-- + <entry key="rhq.agent.plugins.availability-scan.period-secs" value="300"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.measurement-collection.threadpool-size + + When measurement's are scheduled for collection, the collection + will be performed by threads from a thread pool. This defines + the number of threads within that thread pool, effectively + defining the number of measurements that can be collected + concurrently. + --> + <!-- + <entry key="rhq.agent.plugins.measurement-collection.threadpool-size" value="5"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.measurement-collection.initial-delay-secs + + Defines the delay before the first measurement collection is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.measurement-collection.initial-delay-secs" value="30"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.drift-detection.initial-delay-secs + + Defines the delay before the first drift detection scan is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.drift-detection.initial-delay-secs" value="30"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.drift-detection.period-secs + + Defines how often a drift detection scan is run. This type + of scan is used to determine what, if any, file changes (such + as additions, deletions, modifications) occurred within + specific file system locations that are being monitored. + --> + <!-- + <entry key="rhq.agent.plugins.drift-detection.period-secs" value="60"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.content-discovery.threadpool-size + + When plugins are scheduled to discover content, the discovery + will be performed by threads from a thread pool. This defines + the number of threads within that thread pool. + --> + <!-- + <entry key="rhq.agent.plugins.content-discovery.threadpool-size" value="10"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.content-discovery.initial-delay-secs + + Defines the delay before the first content discovery is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.content-discovery.initial-delay-secs" value="60"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.content-discovery.period-secs + + Defines how often content discoveries are run. The value is + specified in seconds. If this value is 0 or less, content + discovery will be disabled. Content discovery is used to + detect new or changed content that are associated with + resources in inventory. + --> + <!-- + <entry key="rhq.agent.plugins.content-discovery.period-secs" value="30"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.configuration-discovery.initial-delay-secs + + Defines the delay before the first configuration discovery is + run. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.configuration-discovery.initial-delay-secs" value="300"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.configuration-discovery.period-secs + + Defines how often configuration discoveries are run. The value is + specified in seconds. If this value is 0 or less, configuration + discovery will be disabled. Configuration discovery is + performed to detect changes in a managed resource's + configuration settings. + --> + <!-- + <entry key="rhq.agent.plugins.configuration-discovery.period-secs" value="3600"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.event-sender.initial-delay-secs + + Defines the delay before the first event report gets sent + to the server. The value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.event-sender.initial-delay-secs" value="30"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.event-sender.period-secs + + Defines how often event reports get sent to the server. The + value is specified in seconds. + --> + <!-- + <entry key="rhq.agent.plugins.event-sender.period-secs" value="30"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.event-report.max-per-source + + Defines the maximum number of events for any given event source + that can be placed in a single event report that is sent up + to the server. If this number is larger than the max-total + setting, then this setting is ignored. + --> + <!-- + <entry key="rhq.agent.plugins.event-report.max-per-source" value="200"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.event-report.max-total + + Defines the total maximum number of events that can be placed + in a single event report that is sent up to the server. + --> + <!-- + <entry key="rhq.agent.plugins.event-report.max-total" value="400"/> + --> + + <!-- + _______________________________________________________________ + rhq.agent.plugins.disabled + + Defines the names of the plugins that are to be disabled. + This is a comma-separated list of plugin names, where a + plugin name is found in the name attribute in the root XML + element in the plugin descriptor. A disabled plugin will + simply not be loaded in the plugin container. + + By default, all plugins are enabled. If a plugin was marked + as disabled by the server, the agent will not download it and + will not load it, regardless of the value of this preference. + If a plugin is enabled on the server, this + preference will override that enable setting (in other words, + an agent is able to disable a plugin, effectively overriding + the server setting, by placing the plugin name in this + preference). If the agent already has a plugin jar in + its local plugins directory, but that plugin is disabled + via this preference, that local plugin jar file will be + deleted and the plugin will not be loaded. + --> + <!-- + <entry key="rhq.agent.plugins.disabled" value=""/> + --> + + <!-- + _______________________________________________________________ + rhq.communications.configuration-schema-version + + Defines what version of the agent configuration schema this + file conforms to. This is the schema for the + rhq.communications preferences. + --> + <entry key="rhq.communications.configuration-schema-version" value="1" /> + + <!-- + _______________________________________________________________ + rhq.communications.service-container.mbean-server-name + + Name of the MBean Server that houses the communications MBean + services. This is actually the default domain name of the + MBean Server and if an MBean Server has already been registered + with this name, it will be used to house the communications + services. If an MBean Server has not yet been registered with + this name as its default domain, one will be created. Typically + this can be left undefined which means the fallback MBeanServer + to be used is the built-in JVM platform MBeanServer. + --> + <entry key="rhq.communications.service-container.mbean-server-name" value="embedded-agent" /> + + <!-- + _______________________________________________________________ + rhq.communications.data-directory + + The location where the communication services write internal + data files. If not defined, the data directory will be the + same as the agent's. + --> + <!-- + <entry key="rhq.communications.data-directory" value="data" /> + --> + + <!-- + _______________________________________________________________ + rhq.communications.global-concurrency-limit + + The maximum number of incoming commands that are allowed to be + received concurrently. Zero or less indicates there is to + be no limit and the agent can accept as many incoming + commands as possible. By default, there is no limit + and you typically did not have to change this from its + default. + --> + <entry key="rhq.communications.global-concurrency-limit" value="-1" /> + + <!-- + _______________________________________________________________ + rhq.communications.multicast-detector.enabled + rhq.communications.multicast-detector.multicast-address + rhq.communications.multicast-detector.bind-address + rhq.communications.multicast-detector.port + rhq.communications.multicast-detector.default-time-delay + rhq.communications.multicast-detector.heartbeat-time-delay + + The multicast detector configuration. This is the service that + listens for new remote servers coming on and going offline and + is required if you want server auto-detection. If you do not + have server auto-detection enabled or your network will not + support multicast traffic, you should disable the multicast + detector. + + The multicast-address is used to broadcast detection messages. + To be more specific, it is the IP address of the + multicast group the detector will join. The bind-address + is the IP that is bound by the network interface. + + The detector will send heartbeat messages every X milliseconds + (this is the heartbeat-time-delay). If external servers' + detectors do not send their heartbeat messages within the + default-time-delay, our detector will assume that external + server has gone down. These settings affect the timeliness + of our auto-detection mechanism. + + EMBEDDED: since the agent is running inside the server, no need + to try to auto-discover it since, if the agent is up, it knows + the server is, too. + --> + <entry key="rhq.communications.multicast-detector.enabled" value="false" /> + <entry key="rhq.communications.multicast-detector.multicast-address" value="224.16.16.16" /> + <entry key="rhq.communications.multicast-detector.bind-address" value="0.0.0.0" /> + <entry key="rhq.communications.multicast-detector.port" value="16162" /> + <entry key="rhq.communications.multicast-detector.default-time-delay" value="5000" /> + <entry key="rhq.communications.multicast-detector.heartbeat-time-delay" value="1000" /> + + <!-- + _______________________________________________________________ + rhq.communications.connector.rhqtype + rhq.communications.connector.transport + rhq.communications.connector.bind-port + rhq.communications.connector.bind-address + rhq.communications.connector.transport-params + rhq.communications.connector.lease-period + + The agent's connector configuration. This is the service that + listens for incoming client requests and passes them to the + appropriate server-side components for processing. See the + JBoss/Remoting documentation for a full list of options + that can be specified. Note that because this is an XML file, + you must specify "&" in the transport-params value + when needing an ampersand to separate the parameters. + + EMBEDDED: the bind address will be overridden to be the + one used by the server. The bind port is normally overridden + in the jboss-service.xml also. + --> + <entry key="rhq.communications.connector.rhqtype" value="agent" /> + <entry key="rhq.communications.connector.transport" value="socket" /> + <!-- + <entry key="rhq.communications.connector.bind-address" value="127.0.0.1" /> + <entry key="rhq.communications.connector.bind-port" value="26163" /> + --> + <!-- + <entry key="rhq.communications.connector.transport-params" value="clientConnectAddress=127.0.0.1&clientConnectPort=16163&numAcceptThreads=3&maxPoolSize=303&clientMaxPoolSize=304&socketTimeout=60000&enableTcpNoDelay=true&backlog=200" /> + <entry key="rhq.communications.connector.lease-period" value="5000" /> + --> + + <!-- + _______________________________________________________________ + rhq.communications.connector.security.secure-socket-protocol + rhq.communications.connector.security.keystore.file + rhq.communications.connector.security.keystore.algorithm + rhq.communications.connector.security.keystore.type + rhq.communications.connector.security.keystore.password + rhq.communications.connector.security.keystore.key-password + rhq.communications.connector.security.keystore.alias + rhq.communications.connector.security.truststore.file + rhq.communications.connector.security.truststore.algorithm + rhq.communications.connector.security.truststore.type + rhq.communications.connector.security.truststore.password + rhq.communications.connector.security.client-auth-mode + + rhq.agent.client.security.secure-socket-protocol + rhq.agent.client.security.keystore.file + rhq.agent.client.security.keystore.algorithm + rhq.agent.client.security.keystore.type + rhq.agent.client.security.keystore.password + rhq.agent.client.security.keystore.key-password + rhq.agent.client.security.keystore.alias + rhq.agent.client.security.truststore.file + rhq.agent.client.security.truststore.algorithm + rhq.agent.client.security.truststore.type + rhq.agent.client.security.truststore.password + rhq.agent.client.security.server-auth-mode-enabled + + These are the settings that are used if SSL is to be used for + either the server or client communications. These can be left + unset since the defaults will normally suffice. These + properties are here just in case some use case occurs that + require one or more of these settings to be customized. + + Note that if client-auth-mode is specified, it must be one of: + "none", "want", "need". + + EMBEDDED: the agent is in the same VM as the server so there + is no need for transport security since traffic is never + actually routed outside of the VM. + --> + <!-- + <entry key="rhq.communications.connector.security.secure-socket-protocol" value="TLS" /> + <entry key="rhq.communications.connector.security.keystore.file" value="data/keystore.dat" /> + <entry key="rhq.communications.connector.security.keystore.algorithm" value="SunX509" /> + <entry key="rhq.communications.connector.security.keystore.type" value="JKS" /> + <entry key="rhq.communications.connector.security.keystore.password" value="rhqpwd" /> + <entry key="rhq.communications.connector.security.keystore.key-password" value="rhqpwd" /> + <entry key="rhq.communications.connector.security.keystore.alias" value="rhq" /> + <entry key="rhq.communications.connector.security.truststore.file" value="data/truststore.dat" /> + <entry key="rhq.communications.connector.security.truststore.algorithm" value="SunX509" /> + <entry key="rhq.communications.connector.security.truststore.type" value="JKS" /> + <entry key="rhq.communications.connector.security.truststore.password" value="" /> + <entry key="rhq.communications.connector.security.client-auth-mode" value="none" /> + + <entry key="rhq.agent.client.security.secure-socket-protocol" value="TLS" /> + <entry key="rhq.agent.client.security.keystore.file" value="data/keystore.dat" /> + <entry key="rhq.agent.client.security.keystore.algorithm" value="SunX509" /> + <entry key="rhq.agent.client.security.keystore.type" value="JKS" /> + <entry key="rhq.agent.client.security.keystore.password" value="rhqpwd" /> + <entry key="rhq.agent.client.security.keystore.key-password" value="rhqpwd" /> + <entry key="rhq.agent.client.security.keystore.alias" value="rhq" /> + <entry key="rhq.agent.client.security.truststore.file" value="data/truststore.dat" /> + <entry key="rhq.agent.client.security.truststore.algorithm" value="SunX509" /> + <entry key="rhq.agent.client.security.truststore.type" value="JKS" /> + <entry key="rhq.agent.client.security.truststore.password" value="" /> + <entry key="rhq.agent.client.security.server-auth-mode-enabled" value="false" /> + --> + + <!-- + _______________________________________________________________ + rhq.communications.remote-stream-max-idle-time-msecs + + The maximum amount of milliseconds a remoted stream + is allowed to be idle before it is automatically closed and + removed from the server. This means that a client must + attempt to access the remoted stream every X milliseconds + (where X is the value of this setting) or that stream will no + longer be available. Note that this does not mean a client + must read or write the entire stream in this amount of time, + it only means a client must make a request on the stream every + X milliseconds (be it to read or write one byte, see how many + bytes are available to be read, etc). + --> + <entry key="rhq.communications.remote-stream-max-idle-time-msecs" value="300000" /> + + <!-- + _______________________________________________________________ + rhq.communications.command-service-directory.allow-dynamic-discovery + + Flag to allow new command services to be added to the command + services directory during runtime. If this is false, only + those services defined in the + rhq.communications.command-services preference will be available + during the lifetime of the command service directory. + --> + <entry key="rhq.communications.command-service-directory.allow-dynamic-discovery" value="true" /> + + <!-- + _______________________________________________________________ + rhq.communications.command-services + + Command Services that are to be added immediately at startup. + --> + <entry key="rhq.communications.command-services" value="org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService, org.rhq.enterprise.communications.command.impl.identify.server.IdentifyCommandService" /> + + <!-- + _______________________________________________________________ + rhq.communications.remote-pojos + + Objects that are to be created and their remote interfaces + deployed immediately at startup. The format of the value is + a comma separated list of implementation/interface names: + class.to.instantiate.via.noarg.constructor:interface.to.expose + --> + <entry key="rhq.communications.remote-pojos" value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping" /> + + <!-- + _______________________________________________________________ + rhq.agent.do-not-override-prefs-with-sysprops + + EMBEDDED: To avoid having the embedded agent pick up + configuration settings that belong to the server in which it is + embedded, we want to disable the system property overlay + feature of the agent configuration. + --> + <entry key="rhq.agent.do-not-override-prefs-with-sysprops" value="true" /> + + </map> + </node> + </node> + </root> +</preferences> \ No newline at end of file diff --git a/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml b/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml index 3feb3ea..2f1ad89 100644 --- a/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml +++ b/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml @@ -21,8 +21,8 @@ <mbean code="org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner" name="rhq:service=PluginDeploymentScanner"> <attribute name="ScanPeriod">${rhq.server.plugin-scan-period-ms:300000}</attribute> - <attribute name="AgentPluginDir">${jboss.home.dir}/standalone/deployments/rhq.ear/rhq-downloads/rhq-plugins</attribute> - <attribute name="ServerPluginDir">${jboss.home.dir}/standalone/deployments/rhq.ear/rhq-serverplugins</attribute> + <attribute name="AgentPluginDir">${jboss.server.base.dir}/deployments/rhq.ear/rhq-downloads/rhq-plugins</attribute> + <attribute name="ServerPluginDir">${jboss.server.base.dir}/deployments/rhq.ear/rhq-serverplugins</attribute> <attribute name="UserPluginDir">${jboss.home.dir}/../plugins</attribute> </mbean>
diff --git a/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties b/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties index 7b9e7a0..da5427b 100644 --- a/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties +++ b/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties @@ -1,5 +1,5 @@ # location of the plugin jars and other files agents can download directly from sever -rhq.server.agent-files-directory=${jboss.home.dir}/standalone/deployments/rhq.ear/rhq-downloads +rhq.server.agent-files-directory=${jboss.server.base.dir}/deployments/rhq.ear/rhq-downloads # location where data files can be stored rhq.communications.data-directory=${jboss.server.data.dir} # global limit on number of concurrent incoming messages allowed
rhq-commits@lists.fedorahosted.org