Managing automation


  • Data retriever—Automation scripts in the Ruby programming language that run on the target servers to obtain the necessary configuration data.

    Note

    When you upgrade BRPM from 4.6.x or earlier to 4.8.x, resource automation scripts from your previous product version are transferred into 4.8.x as data retriever scripts.

  • Local ruby—Automation scripts in the Ruby programming language that run on the agent host of the engine that starts an automation step.

    Note

    When you upgrade BRPM from 4.6.x or earlier to 4.8.x, automation scripts from your previous product version are transferred into 4.8.x as local ruby scripts.

  • Remote dispatcher—Automation scripts in the Ruby programming language that run on the engine server. They implement various transport protocols (agent types) for transferring files and executing scripts on remote servers. 
    Remote dispatcher scripts are executed based on the agent type of the target server.
  • Local shell—Automation scripts that run on the agent host of the engine that starts an automation step and can be written in any interpreted language available on the engine server.
  • Remote shell—Automation scripts that run on the target servers, perform actions specific to the target server, and can be written in any interpreted language available on the target server.

Note

Automation scripts that use server references in a package do not work in steps.

  1. Log in to BRPM as a user with permissions to access the Settings option under the System tab.
  2. Go to System > Settings > General.
  3. Ensure that Enable Automation is selected.

By default, all automation scripts are run on JRuby. For Local Ruby automation scripts, you can use an alternate Ruby interpreter.

Best practice
BMC recommends that you use Ruby 1.9.3 as this version is supported in BRPM.

  1. Go to RLMhome\releases\productVersion\RPM\config and open the automation_settings.rb file.
  2. In the file, add the $AUTOMATION_RUBY_PATH parameter with the full path to the executable file of the installed alternate Ruby interpreter.

    Example
     $AUTOMATION_RUBY_PATH = "/opt/alternateRuby/bin/ruby"
  3. Save the file.
  4. Restart the BRPM services.
  5. To use the alternate Ruby interpreter, you must specify the alternate_ruby parameter with the value set to true in each Local Ruby script that you want to run on the interpreter.

    Example

    ###
    # command:
    # name: Name of command
    # success:
    # name: Term or Phrase to indicate success
    ###

    #============== User Portion of Script ==================

    # Run the command directly on the localhost
    result = run_command(params, params["command"], '')

    params["alternate_ruby"] = true

    params["success"] = params["success"] || ""

    # Apply success or failure criteria
    if result.index(params["success"]).nil?
    write_to "Command_Failed - term not found: [#{params["success"]}]\n"
    else
    write_to "Success - found term: #{params["success"]}\n"
    end

To disable an alternate Ruby interpreter

Open the appropriate script and delete the line with params["alternate_ruby"] = true. Commenting the line or setting the alternate_ruby parameter to false does not disable alternate Ruby.

Related topic

Default-local-ruby-scripts

Default-remote-shell-scripts

Default-remote-dispatcher-scripts

Integrating

Managing-steps

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*