|Description||Manages resources that have command line executables or scripts as their management interfaces|
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.
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.