All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.rhq-plugin.xml Maven / Gradle / Ivy

Go to download

A plugin for managing resources that have command line executables or scripts as their management interface.

The newest version!
<?xml version="1.0" encoding="UTF-8" ?>

<plugin name="Script"
        displayName="Script"
        description="Manages resources that have command line executables or scripts as their management interfaces"
        package="org.rhq.plugins.script"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="urn:xmlns:rhq-plugin"
        xmlns:c="urn:xmlns:rhq-configuration">


   <server name="Script Server"
           discovery="ScriptDiscoveryComponent"
           class="ScriptServerComponent"
           description="A resource with a command line executable or script as its management interface"
           supportsManualAdd="true">

      <plugin-configuration>
         <c:group name="executableEnvironment" displayName="Executable Runtime Environment">
            <c:simple-property name="executable" required="true" description="The full path to the command line executable or script" />
            <c:simple-property name="workingDirectory" required="false" description="When the executable is invoked, this will be its working directory." />
            <c:list-property name="environmentVariables" required="false" description="Environment variables that are set when executing the executable">
               <c:map-property name="environmentVariable">
                  <c:simple-property name="name" type="string" required="true" summary="true" description="Name of the environment variable"/>
                  <c:simple-property name="value" type="string" required="true" summary="true" description="Value of the environment variable" />
               </c:map-property>
            </c:list-property>
         </c:group>
         <c:group name="avail" displayName="Availability Definition">
            <c:simple-property name="availabilityExecuteCheck" required="false" type="boolean" description="If specified and true, the ability to successfully execute the executable can determine whether or not the managed resource is considered up and available. If you set this to true, you normally do not set the availability regex settings in order to allow availability to be determined based solely on the successful execution, regardless of the exit code or output. If this is false, setting one of the avail regex settings will override it as if it were true."/>
            <c:simple-property name="availabilityExitCodeRegex" required="false" description="If specified, the executable must return an exit code that matches this regular expression if the managed resource is to be considered up and available"/>
            <c:simple-property name="availabilityOutputRegex" required="false" description="If specified, the executable must output text that matches this regular expression if the managed resource is to be considered up and available. Expression is evaluated by Pattern.find() so match actually means first match found in text. Pattern `OK` matches multiline text `Service status\n is OK`. By default ^$ represent start/end of output text. To match start/end of line add (?m). eg. `(?m)^ is OK$`. To match whole multi-line output use (?s), eg. `(?s)Service.*OK`."/>
            <c:simple-property name="availabilityArguments" required="false" description="If the executable needs to be executed in order to determine availability, these are the arguments that will be passed to the executable. If you do not specify the regex settings and you set the execute check setting to false, the executable will not be executed and these arguments will not be used - in this case, availability will be determined by the mere existence of the executable file."/>
         </c:group>
         <c:group name="version" displayName="Version Definition">
            <c:simple-property name="versionArguments" required="false" description="The arguments to pass to the executable that will help determine the version of the managed resource"/>
            <c:simple-property name="versionRegex" required="false" description="The regex that can pick out the version from the executable output. If the regex has a captured group, its matched content will be used as the version. If there is no captured group, the entire output will be used as the version."/>
            <c:simple-property name="fixedVersion" required="false" description="If specified, this will be the version of the managed resource - the executable will not be invoked to determine it." />
         </c:group>
         <c:group name="description" displayName="Description Definition">
            <c:simple-property name="descriptionArguments" required="false" description="The arguments to pass to the executable that will help determine the managed resource description. This can be arguments to enable verbose version output."/>
            <c:simple-property name="descriptionRegex" required="false" description="The regex that can pick out the description from the executable output. If the regex has a captured group, its matched content will be used as the description. If there is no captured group, the entire output will be used as the description."/>
            <c:simple-property name="fixedDescription" required="false" description="If specified, this will be the description of the managed resource - the executable will not be invoked to determine it." />
         </c:group>
         <c:group name="argumentsParsing" displayName="Parsing of Arguments">
             <c:simple-property name="quotingEnabled" displayName="Enable Quoting of Arguments" required="true" type="boolean" default="true">
                 <c:description>
                   &lt;ol&gt;
                     &lt;li&gt;In unquoted text: the escape character preserves the value of any following character&lt;/li&gt;
                     &lt;li&gt;In double-quoted text: the escape character escapes " and itself otherwise is both the escape character and the following character are left intact&lt;/li&gt;
                     &lt;li&gt;In single-quoted text: no escaping can occur&lt;/li&gt;
                   &lt;/ol&gt;
                 </c:description>
             </c:simple-property>
             <c:simple-property name="escapeCharacter" required="true" description="The escape character to be used when parsing arguments. By default the escape character is backslash."
                     default="\">
                 <c:constraint>
                     <c:regex-constraint expression="." />
                 </c:constraint>
             </c:simple-property>
         </c:group>
      </plugin-configuration>

      <!--
         The process-scan element requests the plugin container provide the discovery component for
         this resource type with the results of scanning the machine for running processes. If there is
         no use for this in a given resource type, this entry may be omitted.
      -->
      <!--
      <process-scan name="ScanIdentifier" query="process|basename|match=^java.*,arg|org.jboss.Main|match=.*"/>
      -->

      <operation name="execute"
                 description="Executes the executable with a set of arguments and returns the output and exit code.">
         <parameters>
               <c:simple-property name="arguments" required="false" description="The arguments to pass to the executable." />
               <c:simple-property name="waitTime" required="false" type="long" description="The number of seconds to wait for the process to end. If 0 or less, the operation will return immediately without waiting for the script to complete. Default is one hour." />
               <c:simple-property name="captureOutput" required="false" type="boolean" description="If true, the script's output will be captured and returned. Default is true." />
               <c:simple-property name="killOnTimeout" required="false" type="boolean" description="If true, and if waitTime parameter is greater than 0, the script will be forcibly terminated if the wait time expires before the script finishes. In other words, the script process will be killed if it times out. Default is true." />
         </parameters>
         <results>
             <c:simple-property name="exitCode" type="integer" required="false" description="The exit code returned when the script terminated. This will not be set if the script was not waited for (i.e. the wait time was 0) or if the wait time expired before the script finished."/>
             <c:simple-property name="output" type="longString" required="false" description="The output of the script. This will not be set if the operation was told not to capture the output."/>
         </results>
      </operation>

      <!--
         For each measurement that should be collected for resources of this type, a metric element is added.
         In addition to identifying the metric, a default collection interval and whether or not the
         metric is even collected by default are indicated. If the resource has no measurements to be
         collected, these elements may be omitted. Note that the metric property string contains information
         like the arguments to pass to the executable and an optional regex to use to pick out the metric
         value from the output of the executable. The arguments are specified inside curly braces. If the metric
         value is the entire output, you do not have to specify a regex, the output will be assumed to be
         the value of the metric in that case. If regex is explicitly the string "exitcode", the metric value will be
         the CLI executable's exitcode value.
      -->
      <!--
      <metric property="{arguments}|regex"
              dataType="measurement"
              displayName="The Measurement Name"
              description="Describes what this measurement is actually telling you"
              units="none"
              displayType="summary"
              category="performance" />
      -->

   </server>
</plugin>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy