Moogsoft Docs

Configure the Tool Runner

The Tool Runner uses ssh to run tools and integrations. You must edit the servlets configuration file in Moogsoft AIOps in order to use the Tool Runner in the UI.

Before You Begin

Before you begin to configure the Tool Runner, ensure you have met the following requirements:

  • You have created or identified an operating system user that you will use to run tools.

  • You have the permissions to modify Moogsoft AIOps configuration files.

  • You have set the PasswordAuthentication property to yes in the /etc/ssh/sshd_config file on the Moogsoft AIOps server and restarted the sshd service.

Configure the Tool Runner

To manually configure the Tool Runner, edit the Servlets configuration file located at $MOOGSOFT_HOME/config/servlets.conf as follows:

  1. Update these properties in the toolrunner section of the file:

    • Toolrunnerhost: The Tool Runner host to run on. If running a distributed installation this is the host name of the machine where Apache Tomcat is installed.

    • Toolrunneruser: The Tool Runner user name. The user must exist in your system and have the appropriate permissions to run the required tools.

    • Toolrunnerpassword: The Tool Runner user password.

    • Encrypted_toolrunnerpassword: An encrypted Tool Runner password. Use either the password or encrypted password property.

    • Execute_locally:

    • Webhost:

    • Sshtimeout: SSH timeout period in seconds.

  2. Restart Apache Tomcat.

  3. Restart Moogfarmd.

Once you have completed the configuration, Tool Runner is available in the Moogsoft AIOps UI.

An example toolrunner section in the servlets configuration file is as follows:

toolrunner:
{
        toolrunnerhost                                  : "localhost",
        toolrunneruser                                  : "moogtoolrunner",
        toolrunnerpassword                              : "moogtoolrunner",
        #encrypted_toolrunnerpassword   : "rmW2daCwMyI8JGZygfEJj0MZdbIkUqX3tT/OIVfMGyI=",
        #execute_locally                                : false,
        #webhost                                                : "https://localhost",
        sshtimeout                                              : 900000
}
Script to Create a Tool Runner User

To create a script that automatically creates a tool runner user with the default configuration, copy the following code into a file and save it. For example, to a script file named toolrunner_script.sh:

#!/bin/bash
# toolrunner script to automatically create a user that matches the default configuration 
DIVD="================================================================================"
DONN="=========================================================================== DONE"

echo $DIVD
echo "LOG: creating moogtoolrunner user"
useradd -g moogsoft moogtoolrunner
echo -e "moogtoolrunner\nmoogtoolrunner\n" | passwd moogtoolrunner
echo "" >> /home/moogtoolrunner/.bashrc
echo '# adding path to moogtoolrunner user' >> /home/moogtoolrunner/.bashrc
echo 'export MOOGSOFT_HOME=/usr/share/moogsoft' >> /home/moogtoolrunner/.bashrc
echo 'export JAVA_HOME=/usr/java/latest' >> /home/moogtoolrunner/.bashrc
echo 'export APPSERVER_HOME=/usr/share/apache-tomcat' >> /home/moogtoolrunner/.bashrc
echo 'export PATH=$PATH:$MOOGSOFT_HOME/bin:$MOOGSOFT_HOME/bin/utils' >> /home/moogtoolrunner/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOOGSOFT_HOME/lib:/usr/GNUstep/Local/Library/Libraries:/usr/GNUstep/System/Library/Libraries:/usr/java/jdk1.8.0_20/jre/lib/amd64/server' >> /home/moogtoolrunner/.bashrc
echo $DONN
echo

echo $DIVD
echo "LOG: changing ownership of init scripts"
sed -i 's/PROCESS_OWNER=moogsoft/PROCESS_OWNER=moogtoolrunner/g' /etc/init.d/*
echo "doublecheck: "
egrep PROCESS_OWNER= /etc/init.d/* --color
echo $DONN
echo

Run the script on a clean installation of Moogsoft AIOps.