Implement Client Tools

You can create client tools in Moogsoft AIOps to execute actions through a specified URL. The client tools can send Situation and alert data to the URL.

Client tools can return HTTP response data. The response data includes the HTTP response and HTTP message body. See HTTP Response for more information. Providing a more detailed response in the UI, that includes response status and data, can yield useful and important information. For example, tools to link to an external trouble ticket system (via its URL) can open a new ticket using data from the selected Situation.

There are two different types of client tools: alert client tools and Situation client tools.

Create a new client tool

To set up a new alert client tool or a new Situation client tool.

  1. Click Alert Client Tools or Situation Client Tools in the Tools section of the Settings tab.

  2. On the Tool tab, click the + icon to create a new tool.

  3. Fill in the available fields to define the tool:

    Field

    Input

    Description

    Name

    String (Required)

    Name for the client tool (up to 100 characters).

    Description

    String

    Text description of the tool.

    Context Filter

    Filter

    Click the pencil icon to create a filter for specific criteria which the alerts or Situations must match for this tool to be available.

  4. Select whether you want to create a URL Tool or you want to Merge Custom Info.

    When creating a client tool, you can enter Situation or alert attributes, and prompt variables, in the URL, Custom Info, and URL Encoded Content fields. For example, you can enter $description for the contents of the Situation or alert description field.

  5. To create a tool that uses a URL, complete the following fields:

    Field

    Input

    Description

    Show All Response Data

    Boolean

    If enabled, the tool returns a more detailed response in the UI, including the response status and data.

    HTTP Method

    GET

    POST

    Select GET if the tool needs to retrieve information or select POST if the tool needs to send information.

    Open Window

    Boolean

    If enabled, this opens a new browser window when using the GET HTTP Method.

    This disables the Show All Response Data option.

    URL

    String

    URL of the Client Tool.

    You can add prompt variables. Type '$' and select an existing variable or enter a new variable. If you enter a new prompt variable, see Add prompt variables for details.

    URL Formatted Content

    String

    Payload data that is to be posted when the tool is run when using the POST HTTP Method. The payload data must be URL encoded and can include Situation and alert attributes and prompt variables.

    To add a prompt variable, type '$' and select an existing variable or enter your own variable. If you enter a new prompt variable, see Add prompt variables for details.

  6. To create a tool that uses custom info fields, enter valid JSON for the custom info you want the tool to add. The JSON can include Situation and alert attributes and prompt variables. For example, the following JSON blob adds a set of custom info called "TPS data" that contains a string "From system", the Situation ID and the timestamp for when the Situation was created:

    {"TPS data": ["From system", "$sig_id", "$created_at"]}

    To add a prompt variable, type '$' and select an existing variable or enter your own variable. If you enter a new prompt variable, see Add prompt variables for details.

  7. Prompts appear in the Prompts table if you have added them in the URL, URL Formatted Content, or Custom Info fields. See Add prompt variables for details.

  8. Click Save Changes to add the tool to the list of alert client tools or Situation client tools in the left hand pane.

Add prompt variables

Prompt variables open a message box when the tool is run, prompting the user to type text, a number, or select from a list.

To add a new prompt variable:

  1. In the URL, URL Formatted Content, or Custom Info fields, enter prompt variables in the following format:

    $<prompt_name>

    The prompt name cannot be any of the existing Situation or alert attribute names. The prompt name appears in the Prompts table.

  2. To edit the prompt, double-click on it, or select it and then click Edit Prompt. A new window displays.

  3. Enter a Display Name. This is what appears in the prompt message.

  4. Select whether the user will be prompted for text, a number or a list.

    If you select Text or Number, enter the default value and minimum and maximum length of the prompt. Numbers can be integers or floating point, in which case they are truncated to two decimal places.

    If you select List, enter the default value and add the available list options.

  5. Click Save Changes to add the new tool appears in the list in the left hand pane.

Client custom info tool example with a prompt variable

You can configure client tools to change custom info fields. For example, you can configure a tool to raise a ticket on a third party system to prompt for entries of pre-defined (custom info) values to provide more information in the ticket.

To create a client custom info tool with a prompt variable, select the Merge Custom Info option:

Newscreenshot.png

In this example, the custom info is:

{"LEVEL": $prompt1}

The screenshot below shows how the prompt variable settings can be configured:

ClientTools3.JPG

Run client tools

The client tools can be accessed from the following areas:

  • Alert Client Tools: On the Alert Tools Menu, see Alerts Overview (Right-Click menu). Or via "Situation Alerts" in a Situation Room.

  • Situation Client Tools: The Situation Tools Menu, from the Tools menu on the Situation Room or via ChatOps in the Collaborate tab.

If you want to run Client Tools using Safari, go to Safari > Preferences > Security and uncheck 'Block pop-up windows' as this is checked by default.

Run client tool example

To run a tool 'Set LEVEL data for TPS':

  • Go to an alert, right-click or click Tools > Tools > 'Set LEVEL data for TPS'.

  • The following prompt appears:

    ClientTools4.JPG
  • Click OK to run the tool.