Configure a Custom Control Action

Topics marked with * relate to features available only in vFabric Hyperic.

This page has instructions for how to configure Hyperic to run a script or executable that implements a resource control action. To learn about control actions in Hyperic see Run Resource Control Actions.

Step 1 - Install Executable

Install the executable that implements the control action on each managed platform where it will be used. Note that the account under which the Hyperic Agent runs must have:

  • Adequate permissions to run the file.

  • Adequate permissions to perform the tasks defined in the executable.

You can control the permissions required to run the file with chmod or an equivalent utility in your environment. If the tasks defined in the executable require permissions not granted to the account the Hyperic Agent runs under, one option is to add specific "NOPASSWD" entries in the sudoers file on the platform.

As a best practice, create a "control_scripts" (or similar) directory in /opt/hyperic, or a directory high enough in the agent installation that it will not be overwritten during an agent upgrade.

Step 2 - Configure Control Action as a Platform Service

In this step, you must configure the means by which an authorized user can invoke the custom control action. To do so, you configure it as a platform service of type "FileServer File Service" on each platform where the action will be used.

  1. Browse to the platform in the Resource Hub.

  2. Select "New Platform Service" from the Tools menu.

  3. Name the service.

    • Note: Including the platform name in the name for the new service will help you distinguish it from other services of the same type.

  4. (Optional) Describe the functionality of the control action in "Description".

  5. Select "FileServer File" from the "Service Type" pulldown.

  6. Click OK.

    • The Inventory page for the new platform service appears.

  7. Click Edit in the "Configuration Properties" section of the Inventory page.

    • The Configuration Properties page for the new platform service appears.

  8. On the Configuration Properties page:

    1. path — Enter the path to the executable in the "path" field in the "Shared" section, including the name of the file itself. This can be a relative path if the executable is in the Hyperic Agent directory structure. A better practice is to store the script external to the agent directory structure, and specify the full path to the executable, for example, /opt/hyperic/control_scripts/

    2. timeout — Check the value in the "timeout" field in the "Control" section. This is the time in seconds HQ will wait for a response from the control before declaring it as a failed action. The default is 30 seconds, and under most circumstances should be adequate.

  9. If the executable requires higher privileges than those available to the account running the Hyperic Agent, you can use the "prefix" field in the "Control" section to specify the sudo command. In this case, the local sudoers file has an entry for the user to run the script with a NOPASSWD directive.

  10. Click OK.