Documentation/Administration/Managing Hosts

From ScriptRunner
Jump to: navigation, search


Documentation :: Administration :: Manage Hosts

ScriptRunner allows users to run scripts on any number of hosts, not just the host the ScriptRunner controller is installed on. There are two ways the ScriptRunner controller can initiate scripts on other hosts:

  • Initiating scripts over SSH
  • Using a ScriptRunner Agent

For small installations where only a few hosts are required then using SSH to run remote scripts should suffice. For larger installations, and especially those using Batch Schedules, hosts should ideally be each running an agent.


Adding a Script Host

  • From the menu, select Manage Script Hosts.
  • Click NewButton.png.
  • The Create Script Host form should now be shown. Enter details for your new host as prompted.

    CreateScriptHost.png

    • Hostname: For SSH hosts this should be the DNS name the host can be reached at. For hosts running an agent this should be name the host self resolves to (i.e. the value returned if you run the hostname command).
    • User Name: For SSH host, this is the user the script will execute as. For hosts running an agent, this is the user name the agent is running under.
    • Enabled: If not ticked, scripts set to run on this host will not execute and instead will just be queued until the host is set to enabled.
    • Maximum Concurrent Scripts Limit: The maximum number of scripts that can run on the given host at any one given time.
    • Is Batch Controller: Ticking this option sets the host as the controller of all Batch Schedules. Only one host can be the Batch Controller at any time, so ticking this option will remove this role for any other host that is currently set to be the Batch Controller.
    • Has Agent: If ticked ScriptRunner will attempt to run scripts through an agent on this host. If not ticked ScriptRunner will use SSH to run scripts on this host.
    • Agent Port: The port number the agent is listening on. For SSH hosts, leave this blank.
    • Public Key: The public key used to encrypt communications from the controller to the agent. For SSH agents leave this blank.
      You can use the GenerateNewKeyPair.png button a generate a new random key if you do not have one to use already.
    • TLS Enabled: Indicates if an agent can be reached over HTTPS if ticked. If not ticked the controller will communicate to the agent using plain HTTP, although the the message body will be encrypted using agent and controller keys. Leave unticked for SSH hosts.
    • Controller Contactable: If the agent has been setup to allow connections directly from ScriptRunner controllers then this option should be ticked. Controllers will default assume that the agent can not be directly contacted. For more information see Agent Setup. SSH hosts should leave this option unticked.
  • Click SaveButton.png.
  • The new Script Host should now be seen on your list of hosts, and will be immediately ready for use by any scripts or schedules.



Updating a Script Host

  • From the menu, select Manage Script Hosts.
  • Click EditButton.png against the Script Host you wish to update.
  • You should now see the edit window for the Script Host. Update the Script Host configuration as required.

    EditScriptHost.png
    • Hostname: For SSH hosts this should be the DNS name the host can be reached at. For hosts running an agent this should be name the host self resolves to (i.e. the value returned if you run the hostname command).
    • User Name: For SSH host, this is the user the script will execute as. For hosts running an agent, this is the user name the agent is running under.
    • Enabled: If not ticked, scripts set to run on this host will not execute and instead will just be queued until the host is set to enabled.
    • Maximum Concurrent Scripts Limit: The maximum number of scripts that can run on the given host at any one given time.
    • Is Batch Controller: Ticking this option sets the host as the controller of all Batch Schedules. Only one host can be the Batch Controller at any time, so ticking this option will remove this role for any other host that is currently set to be the Batch Controller.
    • Has Agent: If ticked ScriptRunner will attempt to run scripts through an agent on this host. If not ticked ScriptRunner will use SSH to run scripts on this host.
    • Agent Port: The port number the agent is listening on. For SSH hosts, leave this blank.
    • Public Key: The public key used to encrypt communications from the controller to the agent. For SSH agents leave this blank.
      You can use the GenerateNewKeyPair.png button a generate a new random key if you do not have one to use already.
    • TLS Enabled: Indicates if an agent can be reached over HTTPS if ticked. If not ticked the controller will communicate to the agent using plain HTTP, although the the message body will be encrypted using agent and controller keys. Leave unticked for SSH hosts.
    • Controller Contactable: If the agent has been setup to allow connections directly from ScriptRunner controllers then this option should be ticked. Controllers will default assume that the agent can not be directly contacted. For more information see Agent Setup. SSH hosts should leave this option unticked.
  • Click SaveButton.png.
  • The Script Host has now been updated.
    Changes for agents might take a minute or so to update due to the polling frequency for such changes from agents.



Removing a Script Host

Script Hosts that are still assigned to a Script, Scheduled Script or Batch Script can not be removed. It is recommended that you disable a Script Host first to help identify anything currently using that host.


  • From the menu, select Manage Script Hosts.
  • Click RemoveButton.png against the Script Host you wish to remove.
  • Click RemoveConfirmButton.png on the confirmation prompt.

    RemoveScriptHost.png
  • If the script host is still assigned to a Script, Scheduled Script or Batch Script then you will receive an error, otherwise you will see confirmation the Script Host has been removed and it should no longer be seen on the list of Script Hosts in the Manage Script Hosts screen.