|
From: <ma...@rh...> - 2009-01-30 23:16:22
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [2854] agentcopy scripts - used to spawn multiple but separate agent distributions on the same box.</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>2854</dd> <dt>Author</dt> <dd>mazz</dd> <dt>Date</dt> <dd>2009-01-30 17:16:19 -0600 (Fri, 30 Jan 2009)</dd> </dl> <h3>Log Message</h3> <pre>agentcopy scripts - used to spawn multiple but separate agent distributions on the same box. this current checkin will not work on windows. still working on it.</pre> <h3>Added Paths</h3> <ul> <li><a href="#rhqtrunketcagentspawnsrcscriptsagentcopyagentconfigurationxml">rhq/trunk/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml</a></li> <li><a href="#rhqtrunketcagentspawnsrcscriptsagentcopyproperties">rhq/trunk/etc/agentspawn/src/scripts/agentcopy.properties</a></li> <li><a href="#rhqtrunketcagentspawnsrcscriptsagentcopyxml">rhq/trunk/etc/agentspawn/src/scripts/agentcopy.xml</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunketcagentspawnsrcscriptsagentcopyagentconfigurationxml"></a> <div class="addfile"><h4>Added: rhq/trunk/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml (0 => 2854)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml (rev 0) +++ rhq/trunk/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml 2009-01-30 23:16:19 UTC (rev 2854) </span><span class="lines">@@ -0,0 +1,114 @@ </span><span class="add">+<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'> + +<preferences EXTERNAL_XML_VERSION="1.0"> + <root type="user"> + <map /> + <node name="rhq-agent"> + <map /> + <node name="@@@AGENT_NODE@@@"> + <map> + <entry key="rhq.agent.configuration-schema-version" value="3" /> + <entry key="rhq.agent.configuration-setup-flag" value="true" /> + <entry key="rhq.agent.name" value="agentcopy-@@@AGENT_NODE@@@"/> + <entry key="rhq.agent.server.transport" value="@@@rhq.agent.server.transport@@@" /> + <entry key="rhq.agent.server.bind-port" value="@@@rhq.agent.server.bind-port@@@" /> + <entry key="rhq.agent.server.bind-address" value="@@@rhq.agent.server.bind-address@@@" /> + <entry key="rhq.agent.server.transport-params" value="@@@rhq.agent.server.transport-params@@@" /> + <entry key="rhq.agent.server-auto-detection" value="@@@rhq.agent.server-auto-detection@@@" /> + <entry key="rhq.agent.register-with-server-at-startup" value="true" /> + <entry key="rhq.agent.wait-for-server-at-startup-msecs" value="60000" /> + <entry key="rhq.agent.update-plugins-at-startup" value="true" /> + <entry key="rhq.agent.agent-update.enabled" value="true" /> + <!-- + <entry key="rhq.agent.agent-update.version-url" value="http://127.0.0.1:7080/agentupdate/version" /> + <entry key="rhq.agent.agent-update.download-url" value="http://127.0.0.1:7080/agentupdate/download" /> + --> + <entry key="rhq.agent.primary-server-switchover-check-interval-msecs" value="3600000" /> + <entry key="rhq.agent.vm-health-check.interval-msecs" value="5000" /> + <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" /> + <entry key="rhq.agent.data-directory" value="data" /> + <entry key="rhq.agent.client.queue-size" value="50000" /> + <entry key="rhq.agent.client.max-concurrent" value="@@@rhq.agent.client.max-concurrent@@@" /> + <entry key="rhq.agent.client.command-timeout-msecs" value="@@@rhq.agent.client.command-timeout-msecs@@@" /> + <entry key="rhq.agent.client.retry-interval-msecs" value="@@@rhq.agent.client.retry-interval-msecs@@@" /> + <entry key="rhq.agent.client.max-retries" value="@@@rhq.agent.client.max-retries@@@" /> + <entry key="rhq.agent.client.server-polling-interval-msecs" value="@@@rhq.agent.client.server-polling-interval-msecs@@@" /> + <entry key="rhq.agent.client.command-spool-file.name" value="command-spool.dat" /> + <entry key="rhq.agent.client.command-spool-file.params" value="10000000:75" /> + <entry key="rhq.agent.client.command-spool-file.compressed" value="true" /> + <entry key="rhq.agent.client.send-throttling" value="@@@rhq.agent.client.send-throttling@@@" /> + <entry key="rhq.agent.client.queue-throttling" value="@@@rhq.agent.client.queue-throttling@@@" /> + <entry key="rhq.agent.client.command-preprocessors" value="org.rhq.enterprise.agent.SecurityTokenCommandPreprocessor" /> + <entry key="rhq.agent.disable-native-system" value="@@@rhq.agent.disable-native-system@@@"/> + <entry key="rhq.agent.primary-server-switchover-check-interval-msecs" value="3600000" /> + <entry key="rhq.agent.plugins.directory" value="plugins"/> + <entry key="rhq.agent.plugins.server-discovery.initial-delay-secs" value="@@@rhq.agent.plugins.server-discovery.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.server-discovery.period-secs" value="@@@rhq.agent.plugins.server-discovery.period-secs@@@"/> + <entry key="rhq.agent.plugins.service-discovery.initial-delay-secs" value="@@@rhq.agent.plugins.service-discovery.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.service-discovery.period-secs" value="@@@rhq.agent.plugins.service-discovery.period-secs@@@"/> + <entry key="rhq.agent.plugins.availability-scan.initial-delay-secs" value="@@@rhq.agent.plugins.availability-scan.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.availability-scan.period-secs" value="@@@rhq.agent.plugins.availability-scan.period-secs@@@"/> + <entry key="rhq.agent.plugins.measurement-collection.threadpool-size" value="@@@rhq.agent.plugins.measurement-collection.threadpool-size@@@"/> + <entry key="rhq.agent.plugins.measurement-collection.initial-delay-secs" value="@@@rhq.agent.plugins.measurement-collection.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.content-discovery.threadpool-size" value="@@@rhq.agent.plugins.content-discovery.threadpool-size@@@"/> + <entry key="rhq.agent.plugins.content-discovery.initial-delay-secs" value="@@@rhq.agent.plugins.content-discovery.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.content-discovery.period-secs" value="@@@rhq.agent.plugins.content-discovery.period-secs@@@"/> + <entry key="rhq.agent.plugins.configuration-discovery.initial-delay-secs" value="@@@rhq.agent.plugins.configuration-discovery.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.configuration-discovery.period-secs" value="@@@rhq.agent.plugins.configuration-discovery.period-secs@@@"/> + <entry key="rhq.agent.plugins.event-sender.initial-delay-secs" value="@@@rhq.agent.plugins.event-sender.initial-delay-secs@@@"/> + <entry key="rhq.agent.plugins.event-sender.period-secs" value="@@@rhq.agent.plugins.event-sender.period-secs@@@"/> + <entry key="rhq.agent.plugins.event-report.max-per-source" value="@@@rhq.agent.plugins.event-report.max-per-source@@@"/> + <entry key="rhq.agent.plugins.event-report.max-total" value="@@@rhq.agent.plugins.event-report.max-total@@@"/> + <entry key="rhq.communications.configuration-schema-version" value="1" /> + <entry key="rhq.communications.service-container.mbean-server-name" value="jboss-on" /> + <entry key="rhq.communications.data-directory" value="data" /> + <entry key="rhq.communications.global-concurrency-limit" value="-1" /> + <entry key="rhq.communications.multicast-detector.enabled" value="true" /> + <entry key="rhq.communications.multicast-detector.multicast-address" value="224.16.16.16" /> + <entry key="rhq.communications.multicast-detector.bind-address" value="127.0.0.1" /> + <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" /> + <entry key="rhq.communications.connector.rhqtype" value="agent" /> + <entry key="rhq.communications.connector.transport" value="@@@rhq.communications.connector.transport@@@" /> + <entry key="rhq.communications.connector.bind-port" value="@@@rhq.communications.connector.bind-port@@@" /> + <entry key="rhq.communications.connector.bind-address" value="@@@rhq.communications.connector.bind-address@@@" /> + <entry key="rhq.communications.connector.transport-params" value="@@@rhq.communications.connector.transport-params@@@" /> + <entry key="rhq.communications.connector.lease-period" value="5000" /> + <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="jbossonpw" /> + <entry key="rhq.communications.connector.security.keystore.key-password" value="jbossonpw" /> + <entry key="rhq.communications.connector.security.keystore.alias" value="jbosson" /> + <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="jbossonpw" /> + <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="jbossonpw" /> + <entry key="rhq.agent.client.security.keystore.key-password" value="" /> + <entry key="rhq.agent.client.security.keystore.alias" value="jbosson" /> + <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="jbossonpw" /> + <entry key="rhq.agent.client.security.server-auth-mode-enabled" value="true" /> + <entry key="rhq.communications.remote-stream-max-idle-time-msecs" value="30000" /> + <entry key="rhq.communications.command-service-directory.allow-dynamic-discovery" value="true" /> + <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" /> + <entry key="rhq.communications.remote-pojos" value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping" /> + + </map> + </node> + </node> + </root> +</preferences> </span><span class="cx">\ No newline at end of file Property changes on: rhq/trunk/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml ___________________________________________________________________ </span></pre></div> <a id="svnmimetype"></a> <div class="addfile"><h4>Added: svn:mime-type ( => )</h4> <pre class="diff"> <span class="info">Added: svn:keywords + Date Author Id Revision HeadURL </span></pre></div> <a id="svneolstyle"></a> <div class="addfile"><h4>Added: svn:eol-style ( => )</h4> <pre class="diff"> <span class="info"> Added: rhq/trunk/etc/agentspawn/src/scripts/agentcopy.properties </span><span class="cx">=================================================================== </span><span class="rem">--- rhq/trunk/etc/agentspawn/src/scripts/agentcopy.properties (rev 0) </span><span class="add">+++ rhq/trunk/etc/agentspawn/src/scripts/agentcopy.properties 2009-01-30 23:16:19 UTC (rev 2854) </span><span class="lines">@@ -0,0 +1,52 @@ </span><span class="add">+# The location where a full agent distribution is located. +# This will be copied to the spawn directory for each spawned agent. +agentcopy.agent.dist.dir=../../../../modules/enterprise/agent/target/rhq-agent + +# The location where each spawned agent's distribution will be copied. +# NOTE!! This MUST be a full, absolute path. +agentcopy.agent.spawn.dir=${java.io.tmpdir}/agentcopy + +# The indices to identify each copied agent, must be comma-separated. These +# must be unique numbers because they are used as the agent's port. +# You also use these numbers to set agent-specific override properties +# (e.g. agentcopy.agent.override.PORT.xxxxx). +# The order in this list are the order in which the agents will be started. +agentcopy.agent.spawn.list=55000,55100 + +# The number of milliseconds to pause before an agent is started. +# If you do not define the number of milliseconds to sleep before +# a specific agent is started, the default number of milliseconds is used. +agentcopy.agent.sleep-before-launch-default=5000 +#agentcopy.agent.sleep-before-launch.#####=5000 + +# Define what Java options you pass to each agent. If you do not +# specify Java options for a specific agent index, the javaopts-default +# will be used for that agent. +agentcopy.agent.javaopts-default=-Xms64m -Xmx128m -Djava.net.preferIPv4Stack=true +#agentcopy.agent.javaopts.#####=-Xmx256m -Djava.net.preferIPv4Stack=true + +# Define what additional system properties you want to set on each agent. If +# you do not specify -D options for a specific agent index, the +# sysprops-default will be used for that agent. +agentcopy.agent.sysprops-default=-Don.perftest.scenario=configurable-alphaomega -Don.perftest.server-omega-count=10 -Don.perftest.service-alpha-count=25 -Don.perftest.service-beta-count=50 +#agentcopy.agent.sysprops-default=-Don.perftest.scenario=configurable-average -Don.perftest.server-a-count=10 -Don.perftest.service-a-count=25 -Don.perftest.service-ab-count=2 +#agentcopy.agent.sysprops.#####=-Don.perftest.scenario=configurable-3 -Don.perftest.server-b-count=10 -Don.perftest.service-b-count=50 + +# These are additional agent command line options that you can pass to an +# agent. These are added to the normal command line options that are always +# passed to each agent. +agentcopy.agent.cmdlineopts-default= +#agentcopy.agent.cmdlineopts.#####=--output=/tmp/output-file + +# In case you want to force your agent to be bound to a specific hostname or IP +agentcopy.bindaddress= + +# Point all agents to this server endpoint +agentcopy.server.bind-address=127.0.0.1 +agentcopy.server.bind-port=7080 + +# AGENT OVERRIDES +# Define override configuration settings for copied agents. +# If you do not override a setting, a default will be assigned. +# NOTE: each agent's bind-port is the same as its +agentcopy.agent.override.55000.rhq.agent.server.bind-address=127.0.0.1 </span></pre></div> <a id="rhqtrunketcagentspawnsrcscriptsagentcopyproperties"></a> <div class="propset"><h4>Property changes: rhq/trunk/etc/agentspawn/src/scripts/agentcopy.properties</h4> <pre class="diff"> </pre></div> <a id="svnmimetype"></a> <div class="addfile"><h4>Added: svn:mime-type ( => )</h4> <pre class="diff"> <span class="info">Added: svn:keywords + Date Author Id Revision HeadURL </span></pre></div> <a id="svneolstyle"></a> <div class="addfile"><h4>Added: svn:eol-style ( => )</h4> <pre class="diff"> <span class="info"> Added: rhq/trunk/etc/agentspawn/src/scripts/agentcopy.xml </span><span class="cx">=================================================================== </span><span class="rem">--- rhq/trunk/etc/agentspawn/src/scripts/agentcopy.xml (rev 0) </span><span class="add">+++ rhq/trunk/etc/agentspawn/src/scripts/agentcopy.xml 2009-01-30 23:16:19 UTC (rev 2854) </span><span class="lines">@@ -0,0 +1,262 @@ </span><span class="add">+<?xml version="1.0" encoding="UTF-8"?> + +<project name="agentcopy" default="help"> + + <taskdef resource="net/sf/antcontrib/antcontrib.properties"> + <classpath> + <pathelement location="${basedir}/ant-contrib-1.0b3.jar"/> + </classpath> + </taskdef> + + <property file="${basedir}/agentcopy.properties" /> + + <if> + <os family="windows"/> + <then> + <property name="iswindows" value="true" /> + <property name="agentcopy.agent.executable" value="rhq-agent.bat" /> + </then> + <else> + <property name="agentcopy.agent.executable" value="rhq-agent-wrapper.sh" /> + </else> + </if> + + <!-- ========== --> + <target name="help"> + <echo> + Target are: copy, start, stop, clean + Run ant -projecthelp for more info. + </echo> + </target> + + <!-- ========== --> + <target name="copy" description="Spawns copies of the source agent distro and configures them."> + <echo>The source agent distro is found here: ${agentcopy.agent.dist.dir}</echo> + <echo>The copied agents will be found here: ${agentcopy.agent.spawn.dir}</echo> + <echo>The list of copied agents is: ${agentcopy.agent.spawn.list}</echo> + + <!-- make sure the source distro exists and we create the dir where we copy all our agents --> + <available file="${agentcopy.agent.dist.dir}" + type="dir" + property="_agentcopy.agent.dist.dir.present"/> + <fail unless="_agentcopy.agent.dist.dir.present" + message="Missing agent distribution at ${agentcopy.agent.dist.dir}"/> + <mkdir dir="${agentcopy.agent.spawn.dir}" /> + + <!-- copy the source agent distro - make one copy for each copied agent --> + <foreach param="_index" + list="${agentcopy.agent.spawn.list}" + target="copy-agent-dist" /> + + <!-- configure each copied agent appropriately --> + <foreach param="_index" + list="${agentcopy.agent.spawn.list}" + target="configure-agent" /> + + <!-- setup the environment settings for each copied agent --> + <foreach param="_index" + list="${agentcopy.agent.spawn.list}" + target="setup-agent-env" /> + </target> + + <!-- ========== --> + <target name="copy-agent-dist" > + <echo>Copying agent distribution for agent [${_index}]</echo> + <copy todir="${agentcopy.agent.spawn.dir}/${_index}"> + <fileset dir="${agentcopy.agent.dist.dir}"/> + </copy> + <chmod dir="${agentcopy.agent.spawn.dir}/${_index}/bin" includes="*.sh" perm="ugo+rx"/> + </target> + + <!-- ========== --> + <target name="configure-agent" > + <echo>Configuring agent [${_index}]</echo> + + <!-- put the template configuration file in the copied agent's distribution --> + <copy tofile="${agentcopy.agent.spawn.dir}/${_index}/conf/agent-configuration.xml" + file="${basedir}/agentcopy-agent-configuration.xml" + overwrite="true"/> + + <!-- override the copied agent's configuration with defined override settings --> + <propertyselector property="_overrides.list" + delimiter="," + match="agentcopy.agent.override.${_index}\.(.*)" + select="\1" + casesensitive="false" /> + <property name="_overrides.list" value="" /> <!-- in case there are no overrides --> + + <foreach list="${_overrides.list}" + delimiter="," + target="override-agent-configuration" + param="_override" /> + + <!-- if we did not specifically override a preference for this agent, give it a default --> + <!-- * we set the agent preference node name to that of its index --> + <!-- * we set the agent's port to that of its index --> + <replace file="${agentcopy.agent.spawn.dir}/${_index}/conf/agent-configuration.xml"> + <replacefilter token="@@@AGENT_NODE@@@" value="${_index}"/> + <replacefilter token="@@@rhq.communications.connector.transport@@@" value="socket"/> + <replacefilter token="@@@rhq.communications.connector.bind-port@@@" value="${_index}"/> + <replacefilter token="@@@rhq.communications.connector.bind-address@@@" value="${agentcopy.bindaddress}"/> + <replacefilter token="@@@rhq.communications.connector.transport-params@@@" value="numAcceptThreads=3&amp;amp;maxPoolSize=303&amp;amp;clientMaxPoolSize=304&amp;amp;socketTimeout=60000&amp;amp;enableTcpNoDelay=true&amp;amp;backlog=200"/> + <replacefilter token="@@@rhq.agent.server.transport@@@" value="servlet"/> + <replacefilter token="@@@rhq.agent.server.bind-port@@@" value="${agentcopy.server.bind-port}"/> + <replacefilter token="@@@rhq.agent.server.bind-address@@@" value="${agentcopy.server.bind-address}"/> + <replacefilter token="@@@rhq.agent.server.transport-params@@@" value="/jboss-remoting-servlet-invoker/ServerInvokerServlet"/> + <replacefilter token="@@@rhq.agent.server-auto-detection@@@" value="true"/> + <replacefilter token="@@@rhq.agent.client.server-polling-interval-msecs@@@" value="60000"/> + <replacefilter token="@@@rhq.agent.client.max-concurrent@@@" value="5"/> + <replacefilter token="@@@rhq.agent.client.command-timeout-msecs@@@" value="0"/> + <replacefilter token="@@@rhq.agent.client.retry-interval-msecs@@@" value="15000"/> + <replacefilter token="@@@rhq.agent.client.max-retries@@@" value="10"/> + <replacefilter token="@@@rhq.agent.client.send-throttling@@@" value="100:1000"/> + <replacefilter token="@@@rhq.agent.client.queue-throttling@@@" value="200:2000"/> + <replacefilter token="@@@rhq.agent.disable-native-system@@@" value="false"/> + <replacefilter token="@@@rhq.agent.plugins.operation-invocation-timeout-secs@@@" value="600"/> + <replacefilter token="@@@rhq.agent.plugins.operation-invoker.threadpool-size@@@" value="5"/> + <replacefilter token="@@@rhq.agent.plugins.server-discovery.initial-delay-secs@@@" value="10"/> + <replacefilter token="@@@rhq.agent.plugins.server-discovery.period-secs@@@" value="900"/> + <replacefilter token="@@@rhq.agent.plugins.service-discovery.initial-delay-secs@@@" value="20"/> + <replacefilter token="@@@rhq.agent.plugins.service-discovery.period-secs@@@" value="86400"/> + <replacefilter token="@@@rhq.agent.plugins.availability-scan.initial-delay-secs@@@" value="5"/> + <replacefilter token="@@@rhq.agent.plugins.availability-scan.period-secs@@@" value="60"/> + <replacefilter token="@@@rhq.agent.plugins.measurement-collection.threadpool-size@@@" value="5"/> + <replacefilter token="@@@rhq.agent.plugins.measurement-collection.initial-delay-secs@@@" value="30"/> + <replacefilter token="@@@rhq.agent.plugins.content-discovery.threadpool-size@@@" value="10"/> + <replacefilter token="@@@rhq.agent.plugins.content-discovery.initial-delay-secs@@@" value="60"/> + <replacefilter token="@@@rhq.agent.plugins.content-discovery.period-secs@@@" value="30"/> + <replacefilter token="@@@rhq.agent.plugins.configuration-discovery.initial-delay-secs@@@" value="300"/> + <replacefilter token="@@@rhq.agent.plugins.configuration-discovery.period-secs@@@" value="3600"/> + <replacefilter token="@@@rhq.agent.plugins.event-sender.initial-delay-secs@@@" value="30"/> + <replacefilter token="@@@rhq.agent.plugins.event-sender.period-secs@@@" value="30"/> + <replacefilter token="@@@rhq.agent.plugins.event-report.max-per-source@@@" value="200"/> + <replacefilter token="@@@rhq.agent.plugins.event-report.max-total@@@" value="400"/> + </replace> + </target> + + <!-- ========== --> + <target name="override-agent-configuration" > + <propertycopy property="_override.value" + from="agentcopy.agent.override.${_index}.${_override}" + override="true"/> + <echo>Agent [${_index}] will override [${_override}] with the value [${_override.value}]</echo> + <replace file="${agentcopy.agent.spawn.dir}/${_index}/conf/agent-configuration.xml"> + <replacefilter token="@@@${_override}@@@" value="${_override.value}"/> + </replace> + </target> + + <!-- ========== --> + <target name="setup-agent-env" > + <propertycopy property="_javaopts" + from="agentcopy.agent.javaopts-default"/> + <propertycopy property="_javaopts" + from="agentcopy.agent.javaopts.${_index}" + override="true" + silent="true"/> + + <propertycopy property="_sysprops" + from="agentcopy.agent.sysprops-default"/> + <propertycopy property="_sysprops" + from="agentcopy.agent.sysprops.${_index}" + override="true" + silent="true"/> + + <propertycopy property="_cmdlineopts" + from="agentcopy.agent.cmdlineopts-default"/> + <propertycopy property="_cmdlineopts" + from="agentcopy.agent.cmdlineopts.${_index}" + override="true" + silent="true"/> + + <echo> +Agent [${_index}]: +RHQ_AGENT_JAVA_OPTS=${_javaopts} ${_sysprops} +RHQ_AGENT_CMDLINE_OPTS=--daemon --pref=${_index} ${_cmdlineopts} +</echo> + + <echo append="true" file="${agentcopy.agent.spawn.dir}/${_index}/bin/rhq-agent-env.sh"> +# AGENTSPAWN CUSTOMIZATION +RHQ_AGENT_JAVA_OPTS=${_javaopts} ${_sysprops} +RHQ_AGENT_CMDLINE_OPTS=--daemon --pref=${_index} ${_cmdlineopts} + </echo> + + <echo append="true" file="${agentcopy.agent.spawn.dir}/${_index}/bin/rhq-agent-env.bat"> +rem AGENTSPAWN CUSTOMIZATION +set RHQ_AGENT_JAVA_OPTS=${_javaopts} ${_sysprops} +set RHQ_AGENT_CMDLINE_OPTS=--daemon --pref=${_index} ${_cmdlineopts} + </echo> + + </target> + + <!-- ========== --> + <target name="start" description="Starts all the agents."> + <echo>Starting all agents...</echo> + <foreach param="_index" + list="${agentcopy.agent.spawn.list}" + target="run-single-agent" /> + + <echo>All agents should have been started.</echo> + <echo>Will pause for 60 seconds to make sure.</echo> + <sleep seconds="60" /> + </target> + + <!-- ========== --> + <target name="run-single-agent" > + <propertycopy property="_sleep_millis" + from="agentcopy.agent.sleep-before-launch-default"/> + <propertycopy property="_sleep_millis" + from="agentcopy.agent.sleep-before-launch.${_index}" + override="true" + silent="true"/> + + <echo>Pausing for ${_sleep_millis}ms before starting agent [${_index}]</echo> + <sleep milliseconds="${_sleep_millis}"/> + + <echo>Starting agent [${_index}] using [${agentcopy.agent.executable}]</echo> + + <forget> + <exec executable="${agentcopy.agent.spawn.dir}/${_index}/bin/${agentcopy.agent.executable}" + output="${agentcopy.agent.spawn.dir}/${_index}/logs/agentcopy-output.txt"> + <arg line="start" /> + </exec> + </forget> + + </target> + + <!-- ========== --> + <target name="clean" description="Deletes the spawn directory and with it all copies of the source agent distro."> + <echo>Deleting the agents found here: ${agentcopy.agent.spawn.dir}</echo> + <delete dir="${agentcopy.agent.spawn.dir}" /> + </target> + + <!-- ========== --> + <target name="stop" description="Stops all the agents (not available on Windows)."> + <fail if="iswindows" message="Stopping agents with this script is not supported on Windows"/> + + <echo>Stopping all agents...</echo> + <foreach param="_index" + list="${agentcopy.agent.spawn.list}" + target="stop-single-agent" /> + + <echo>All agents should have been stopped.</echo> + </target> + + <!-- ========== --> + <target name="stop-single-agent"> + <loadfile property="_pid" + srcfile="${agentcopy.agent.spawn.dir}/${_index}/bin/.rhq-agent.pid" + failonerror="false"> + <filterchain> + <striplinebreaks/> + </filterchain> + </loadfile> + + <echo>Stopping agent [${_index}] with pid [${_pid}]</echo> + + <exec executable="kill"> + <arg value="-TERM" /> + <arg value="${_pid}" /> + </exec> + </target> + +</project> </span></pre></div> <a id="rhqtrunketcagentspawnsrcscriptsagentcopyxml"></a> <div class="propset"><h4>Property changes: rhq/trunk/etc/agentspawn/src/scripts/agentcopy.xml</h4> <pre class="diff"> </pre></div> <a id="svnmimetype"></a> <div class="addfile"><h4>Added: svn:mime-type ( => )</h4> <pre class="diff"> <span class="info">Added: svn:keywords + Date Author Id Revision HeadURL </span></pre></div> <a id="svneolstyle"></a> <div class="addfile"><h4>Added: svn:eol-style ( => )</h4> <pre class="diff"> <span class="info"> </span></pre> </div> </div> </body> </html> |