JBoss Community Archive (Read Only)

RHQ 4.9

Plugins - Script

Name

Script

Description

Manages resources that have command line executables or scripts as their management interfaces

RHQ Version

1.4.0-SNAPSHOT

Plugin Version

1.0

View Source

http://git.fedorahosted.org/git/rhq/rhq.git?p=rhq/rhq.git;a=tree;f=modules/plugins/script;hb=master

Overview

Sometimes, you may find yourself wanting to manage a resource for which there is no current RHQ plugin or, perhaps, the resource doesn't even have a management API or interface.

This plugin may help manage these "unmanageable" resources.

This plugin will assume there is a command line executable or script that can be used to interface with the managed resource. You manually add your "Script" resource to the RHQ inventory - defining where the command line executable or script is, and how its results/output should be used to determine the state of the managed resource. To be clear, the "CLI" executable/script is not really the managed resource - it is only used to interface with the real managed resource.

There is the ability to show RED or GREEN availability for any Script resource. For example, you can configure the Script plugin to assume the resource is UP (aka GREEN) if:

  • the executable merely exists on the file system, or...

  • the executable was able to run or...

  • the executable ran and returns a certain exit code and/or...

  • the executable ran and output a certain text string

The idea is that there is a command line executable or script that needs to get executed with a certain set of arguments. A successful execution would be determined by a regular expression that needs to match the exit code or output from that CLI.

You can also use the same type of mechanism to define how to invoke the executable to obtain a certain set of metrics. You can define arguments and a regular expression and based on what the executable returns (and what the regex captures) would be the value of the metric data.

This plugin should be useful because it is very generic - you can use it as-is for your own generic resources that have command line interfaces, a developer could extend the plugin classes, or a developer could just write their own plugin descriptor and have it pick up the Script plugin's ability to execute any executable and get the results.

Installation

Install this like any RHQ plugin. There is no auto-discovery support in the script plugin - in order to add a "script" resource to inventory, you must manually add it.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 07:58:35 UTC, last content change 2013-09-18 19:42:00 UTC.