Moogsoft Docs

Situation Server Tools


Situation Server Tools are tools that enable a user to execute a utility on a remote host.

These tools specify a command and arguments that are run using the Tool Runner servlet (which is configured to connect to the remote host).

  • The command can be anything you can run on the host in a Linux terminal command line, such as an inbuilt part of the OS (e.g ping) or your own script
  • The arguments are extracted from Situation attributes by prefixing the attribute name with '$', such as $description  for the Situation description


Please note : In Moogsoft AIOps, the Situation Server Tools managed here are only available form ChatOps in the Situation Room. See "Take Additional Actions" in the Operator Guide .

The steps below describe how to create a Situation Server Tool, its availability filter, command and arguments.

You can also create Situation Server Tools via a command prompt.


Go to System Settings > Tools > Situation Server Tools to open the configuration window:


This can be used to add a new Situation Server Tool

This can be used to delete any selected Situation Server Tool

This can be used to copy any selected Situation Server Tool

Create a new Situation Server Tool

1. Click the to create a new tool.

2. Fill in the available fields to define the tool. These are listed in the table below:

Name String (Mandatory) The name for the Situation Server Tool (up to 100 characters). This appears in ChatOps when accessing the tool
Description String
The text description of the tool
Context Filter Filter

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

Command String

This is the file path of the command


Please note : This command must be an accessible path on the host system. The host system and access information is defined in the Tool Runner servlet

Arguments String
This is the specific input for the command , which can use Situation attributes.
To use Situation attributes, type '$' as a prefix and enter the attribute you want from the drop down list (full list here )
Run For Boolean +
If enabled, you can define the number of seconds the tool will run for. The minimum value for this field is 5 seconds


Please note : To prevent substitution with potentially malicious commands, arguments are escaped using a backslash

For example:
Command: echo
Argument: $args (where $args is echo_something; rm file.txt )
This results in the following command being executed:
echo echo_something\; rm file.txt
The semi-colon is escaped to prevent the rm command from being run

3. Click Save Changes to create the new tool. This will appear in the list to the left of the screen.

To discard any changes, click Revert Changes and confirm when prompted.


Please note : You can also create Situation Server Tools via a command prompt


The screenshot below shows  a Situation Server Tool called 'LogSitnDetails' with the Command : /home/moog/bin/

This tool runs the script on the remote host which logs Situation details to a file.

The details logged are the Situation ID, created time, description and total number of Alerts, which are defined with the Arguments :

 $sig_id $created_at $description $total_alerts

Each Situation attribute name is prefixed with $ . The Context Filter makes this tool available only for Closed Situations.

Edit a Situation Server Tool

1. Select the Situation Server Tool you want to edit or type in the search box to find the required tool.

2. Edit fields as described above.


Please note: You cannot edit the tool Name. If you need to do this, create a duplicate with the name you want. You can then delete the original

3. Click Save Changes .

If you want to discard your changes, click Revert Changes .

Create a Tool with a Command Prompt

You can create Situation Server Tools via a command prompt.

This is useful for efficient creation of multiple tools using a scripted process, for example.

1. Open a new Terminal window on the Moogsoft AIOps system and type the following:


2. Type any flags and arguments for the tool settings. See the examples below.


Moogsoft AIOps command line tools are located here:
To display the help information for this tool, type:
and press Enter .
Use a double-dash prefix " -- " to define all following text as arguments. This ensures arguments are not misinterpreted as flags.
For example, " -- -c " to define the argument " -c ", which would otherwise be interpreted as the command flag

3. When you have defined the tool, press Enter .

If successful, T ool was added appears.


  • If there is a mistype, the help information appears
  • If the tool name already exists, Error: A tool named: [ toolname ] already exists. appears
  • If a Run for time of less than 5 seconds is typed, Error: The run_for value is too small. Please provide a value no smaller than 5 seconds. appears

Once the UI is refreshed, newly created tools will appear in the Situation Server Tools configuration window.


moog_add_sitn_server_tool --name "Sitn Id" --desc "Get the Situation ID" --cmd echo --args "Situation ID = \$sig_id" --run_for 42

This creates a tool with the following settings:

  • Name : Sitn ID ( --name "Sitn ID" ). Quotes are required because there is a space in the name
  • Description : Get the Situation ID ( --desc "Get the Situation ID" )
  • Context Filter : none
  • Command : echo ( --cmd echo )
  • Arguments : display 'Situation ID = ID '
  • ( --args "Situation ID = \$sig_id" ). The backslash is required to escape the '$' because it is an environment variable
  • Run for : 42 seconds ( --run_for 42 )
moog_add_sitn_server_tool -d "five pings" -m "sig_id<10" -c ping -a -- -c 5

This creates a tool with the following settings:

  • Description : five pings ( -d "five pings" )
  • Context Filter : ID < 10 ( -m "sig_id<10" )
  • Command : ping ( -c ping )
  • Arguments : ping five times ( -- -c 5 ). The argument starts with -c which is itself a tool flag. Therefore the "--" double-dash prefix is used to interpret -c 5 as an argument, and not a flag
  • Run for : no time set (no -r flag and argument)
  • Name : ping. The name is not defined here (no -n flag and argument) so the Command is used as the name by default

Available Situation Attributes

These are the Situation attributes available: