Moogsoft Docs

Configure the Tool Runner

You need to add three values in the servlets.conf file to configure Tool Runner before you can use it in the UI.

The toolrunner uses ssh to login to a system with a certain username and password to run tools/integrations. As a result, 'PasswordAuthentication' must to be set to 'yes' in /etc/ssh/sshd_config for this to work. Changes to that file require restarting the sshd service before they take effect.

Edit the servlets.conf file manually

From the Command Line:

  1. Identify/create the user on your OS that will run Tools.

  2. Edit the file:
    $MOOGSOFT_HOME/config/servlets.conf

    Note

    Ensure you have the correct permissions in your System to edit this file

  3. Find the 'Configuration for the toolrunner section' and edit three values in the 'toolrunner section':

    Parameter Description
    toolrunnerhost
    Default: localhost

    If running a distributed install this will be the hostname of the machine where apache-tomcat is installed
    toolrunneruser
    Default: moogtoolrunner

    The user named here needs to exist in your System and have appropriate permissions to run the needed tools (as identified in step 1 above)
    toolrunnerpassword
    Default: moogtoolrunner

    This needs to be the password of the user defined in toolrunneruser (as identified in step 1 above)
    # Configuration for the toolrunner
    
        toolrunner :
    
        {
    
            # The SSH timeout
    
            sshtimeout: 900000,
    
    
            # The toolrunner host to run on
    
            toolrunnerhost: "localhost",
    
    
            # The toolrunner user name
    
            toolrunneruser: "moogtoolrunner",
    
    
            # The toolrunner user password.
    
            # Use either toolrunnerpassword or toolrunnerpassword.
    
            toolrunnerpassword: "moogtoolrunner"
    
            # encrypted_toolrunnerpassword: "rmW2daCwMyI8JGZygfEJj0MZdbIkUqX3tT/OIVfMGyI=",
    
    
            # Uncomment to overwrite the level of logging.
    
            # loglevel: "WARN",
    
    
            # Uncomment to overwrite the web host address
    
            # webhost: "https://localhost"
    
    
            # Uncomment to change the ha definitions
    
            # ha :
    
            # {
    
            #     cluster: "MOO",
    
            #     instance: "toolrunner",
    
            #     group: "toolrunner",
    
            #     start_as_passive: false
    
            # }
    
        },



  4. Stop and restart Apache.

    service apache-tomcat stop
    service apache-tomcat start
  5. Stop and restart moogfarmd.

    service moogfarmd stop
    service moogfarmd start

    The toolrunner is now available in the UI.


Example servlets.conf file

($MOOGSOFT_HOME/config/servlets.conf)

#############################################################

#              Copyright (c) Moogsoft Inc 2016              #

#                                                           #

#-----------------------------------------------------------#

#                                                           #

# The contents of this configuration file may be copied,    #

# amended and used to create derivative works.              #

#                                                           #

#############################################################


#------------------------------------------------------------

# Servlets Configuration

#------------------------------------------------------------

{

   # The level of warning (ALL, INFO, WARN, DEBUG or NONE)

   # Default to WARN

   loglevel: "WARN",


   # The web host address (default to https://localhost)

   webhost : "https://freida",


   # Configuration of the Moog Server

   moogsvr:

   {

        # Set to true to force each user to agree to the end user license

        # agreement

        eula_per_user: false,

        # Location in the file system in which media files will be saved.

        # Default to /tmp

        cache_root: "/var/lib/moogsoft/moog-data",

        #  Number of database connections (default to 10)

        db_connections:	10,

        # Number of database connection in the priority queue (default to 10)

        priority_db_connections: 10

        # Uncomment to overwrite the level of logging.

        # loglevel: "WARN",

        # Uncomment to overwrite the web host address

        # webhost: "https://localhost"

        # Uncomment to change the ha definitions

        # ha :

        # {

        #     cluster: "MOO",

        #     instance: "moogsvr",

        #     group: "moogsvr",

        #     start_as_passive: false

        # }

    },

    # Configuration of the poller

    moogpoller :

    {

        # Uncomment to overwrite the level of logging.

        # loglevel: "WARN",

        # Uncomment to overwrite the web host address

        # webhost: "https://localhost"

        # Uncomment to change the ha definitions

        # ha :

        # {

        #     cluster: "MOO",

        #     instance: "poller",

        #     group: "poller",

        #     start_as_passive: false

        # }

    },

    # Configuration for the toolrunner

    # details in http://docs.moogsoft.com/display/060000/Tool+runner

    toolrunner :

    {

        # The SSH timeout

        sshtimeout: 900000,

        # The toolrunner host to run on

        toolrunnerhost: "localhost",

        # The toolrunner user name

        toolrunneruser: "moogtoolrunner",

        # The toolrunner user password.

        # Use either toolrunnerpassword or toolrunnerpassword.

        toolrunnerpassword: "moogtoolrunner"

        # encrypted_toolrunnerpassword: "rmW2daCwMyI8JGZygfEJj0MZdbIkUqX3tT/OIVfMGyI=",

        # Uncomment to overwrite the level of logging.

        # loglevel: "WARN",

        # Uncomment to overwrite the web host address

        # webhost: "https://localhost"

        # Uncomment to change the ha definitions

        # ha :

        # {

        #     cluster: "MOO",

        #     instance: "toolrunner",

        #     group: "toolrunner",

        #     start_as_passive: false

        # }

    },

    # Graze configuration

    graze  :

    {

        # Uncomment to overwrite the level of logging.

        # loglevel: "WARN"

    },

    # Events configuration

    events  :

    {

        # Uncomment to overwrite the level of logging.

        # loglevel: "WARN"

    }


Edit the servlets.conf file automatically

  1. Copy the following code into a file and name it, for example, 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



  2. Run the file on a clean install of Moogsoft AIOps.