logo

CALLGOOSE

CG Automation Runner

A cg-automation-runner is a jar application deployed on the client-side behind the firewall to securely execute automation tasks in the customer environment. It connects with the Callgoose SQIBS platform to fetch automation job details and execute in the client’s infrastructure.


What is cg-automation-runner?

  • The cg-automation-runner is deployed within the customer’s environment, ensuring that sensitive automation tasks are performed securely behind the firewall.
  • When an automation request is initiated on the Callgoose SQIBS platform, the cg-automation-runner securely connects to the platform, fetches the necessary job details, and executes the task in the local environment.
  • All actions in workflows are executed by the cg-automation-runner within the customer infrastructure.


Configuring the cg-automation-runner

To set up the cg-automation-runner and link it to the Callgoose SQIBS platform, follow these steps:


1. Create 'runner' Profile and download Configuration File

Create an Automation Profile with type 'runner'. When creating the 'runner' profile, you can download a configuration file (File name will be cg-automation-runner-creds.yaml). This file contains the necessary token and secret for the runner to authenticate and securely connect to the Callgoose SQIBS platform. Keep the file in a safe place.


2. Download the JAR

Go to the Callgoose SQIBS dashboard and navigate to 'Profiles' under the Automation category. From there, click the download icon next to the 'Download Runner JAR' title at the top to download the JAR(File name will be cg-automation-runner.jar).


3. Install Java 17 on the host machine

To run the cg-automation-runner.jar, the host machine needs to have Java 17 installed.


Refer to this documentation for How to install Java 17 in Linux, Unix and Windows Operating system


Instructions for Linux and Unix based Operating system

The cg-automation-runner.jar works on any Linux or Unix-based operating system as long as it can run Java-based JAR files. In this section, we provide instructions specifically for Red Hat-based Linux distributions.


4. Place the JAR and Configuration file.


a) Create a user - an example here is cgautouser

useradd cgautouser


b) Create a directory named 'cg-automation-runner' under the home directory.

su - cgautouser
mkdir /home/cgautouser/cg-automation-runner


b) Move the downloaded JAR from step 2 into the 'cg-automation-runner' directory.

ls -ltr /home/cgautouser/cg-automation-runner/cg-automation-runner.jar


c) Create a directory named '.conf' under the 'cg-automation-runner' directory.

mkdir /home/cgautouser/cg-automation-runner/.conf


d) Move the configuration file from step 1 into the '.conf' directory and rename the configuration file inside the '.conf' directory to '.cg-automation-runner-creds.yaml' (we added a '.' at the beginning of the file name)

ls -ltr /home/cgautouser/cg-automation-runner/.conf/.cg-automation-runner-creds.yaml


5. Run the cg-automation-runner JAR manually

After placing all the files in correct place, you can run the JAR.

In Linux:

Open terminal, navigate to the cg-automation-runner directory and run,

java -jar /home/cgautouser/cg-automation-runner/cg-automation-runner.jar

In Windows

Open the command prompt, navigate to the cg-automation-runner directory and run,

java -jar cg-automation-runner.jar


The runner will start and securely connect to the Callgoose SQIBS platform using the provided token and secret.

Once connected, it will be ready to execute automation jobs based on the assigned workflows.

If there are errors while starting the JAR, they will be displayed directly in the terminal or command prompt.


5. Run the cg-automation-runner JAR as a systemd service in Linux


Create a cg-automation-runner.service file using any editor.


sudo vim /usr/lib/systemd/system/cg-automation-runner.service


[Unit]
Description= Start the cg-automation-runner service
After=syslog.target systemd-user-sessions.service network.target

[Service]
Type=simple
User=cgautouser
Group=cgautouser
LimitNOFILE=64000
LimitNPROC=64000
ExecStart=java -jar /home/cgautouser/cg-automation-runner/cg-automation-runner.jar

[Install]
WantedBy=multi-user.target


sudo systemctl enable cg-automation-runner.service
sudo systemctl start cg-automation-runner.service
sudo systemctl status cg-automation-runner.service


6. Check Log

Check the log generated by cg-automation-runner.jar to ensure everything is correct.

The log file (cg-automation-runner.log) will be saved inside the 'log' directory, which is located under the 'cg-automation-runner' directory.

A successful run will generate a log similar to the one below:

# tail -f /home/cgautouser/cg-automation-runner/log/cg-automation-runner.log

2024-09-06 13:29:59 [ INFO  ] Starting cg-automation-runner <VERSION>
2024-09-06 13:29:59 [ INFO  ] Database initialized successfully.
2024-09-06 13:29:59 [ INFO  ] Syncing profile details
2024-09-06 13:30:00 [ INFO  ] Internal profile details updated successfully.
2024-09-06 13:30:00 [ INFO  ] Profile details syncing completed
2024-09-06 13:30:01 [ INFO  ] The Runner JAR is running smoothly.


Upon a successful run, the Runner Profile on the dashboard will change its status from 'Inactive' to 'Active'.


Instructions for Windows Operating System

The cg-automation-runner.jar works on any Windows operating system as long as it can run Java-based JAR files. In this section, we provide instructions specifically for Windows Server 2022.


7. Set Up the CG Automation Runner Service in Windows Server 2022


This guide will help you set up the CG Automation Runner as a Windows service using WinSW (Windows Service Wrapper). The steps below will ensure your service runs automatically at boot and logs activity for troubleshooting.


8. Create User (Optional)


You can create a specific user to run the CG Automation Runner service if required.


powershell

New-LocalUser -Name "cgautouser" -Password (ConvertTo-SecureString "MyCallgoose@+2024" -AsPlainText -Force) -FullName "CG Automation User" -Description "User for running CG Automation Runner"


9. Create the Required Directories


We’ll place the CG Automation Runner JAR and configuration files in the C:\callgoose\cg-automation-runner\ directory. Adjust the path if necessary.


powershell

# Create the directory structure
New-Item -Path "C:\callgoose\cg-automation-runner" -ItemType Directory
New-Item -Path "C:\callgoose\cg-automation-runner\.conf" -ItemType Directory


10. Place the JAR and Configuration File


  • Move the downloaded JAR (from step 2 in your setup) to the C:\callgoose\cg-automation-runner\ directory.

Verify that the JAR is placed correctly:

powershell

Get-ChildItem "C:\callgoose\cg-automation-runner\cg-automation-runner.jar"
  • Move the configuration file (from step 1) into the .conf directory and rename it .cg-automation-runner-creds.yaml.

Verify the credentials file:

powershell

Get-ChildItem "C:\callgoose\cg-automation-runner\.conf\.cg-automation-runner-creds.yaml"

11. Run the CG Automation Runner JAR as a Windows Service Using WinSW


11.1. Download WinSW

  • Visit the WinSW Releases page and download the WinSW-x64.exe file suitable for your Windows OS.
  • Place the downloaded WinSW-x64.exe file in the C:\callgoose\cg-automation-runner directory.


11.2. Rename the WinSW Executable


Rename the WinSW executable to cg-automation-runner.exe.

powershell

Rename-Item "C:\callgoose\cg-automation-runner\WinSW-x64.exe" "C:\callgoose\cg-automation-runner\cg-automation-runner.exe"


11.3. Create a Configuration File for WinSW


In the same directory (C:\callgoose\cg-automation-runner), create an XML configuration file called cg-automation-runner.xml.


Sample cg-automation-runner.xml content:

xml

<service>
  <id>cg-automation-runner</id>
  <name>CG Automation Runner Service</name>
  <description>Runs the Callgoose CG Automation Runner JAR as a service</description>
  <executable>java</executable>
  <arguments>-jar C:\callgoose\cg-automation-runner\cg-automation-runner.jar</arguments>
  <logpath>C:\callgoose\cg-automation-runner\log</logpath>
  <logmode>roll</logmode>
  <startmode>Automatic</startmode>
</service>


11.4. Install the Service

  • Open PowerShell as Administrator.
  • Navigate to the C:\callgoose\cg-automation-runner directory.
  • Run the following command to install the service:
powershell

cd C:\callgoose\cg-automation-runner
.\cg-automation-runner.exe install


11.5. Start the Service


Once the service is installed, start it by running:

powershell

.\cg-automation-runner.exe start


11.6. Verify the Service Status

Check whether the service is running:

powershell

sc query "cg-automation-runner"


11.7. Check Logs

The service logs will be saved in the C:\callgoose\cg-automation-runner\log directory, as specified in the XML configuration. You can view the logs to ensure the service is functioning correctly.

powershell

Get-Content -Path "C:\callgoose\cg-automation-runner\log\cg-automation-runner.log" -Tail 10

Important Notes:

  • No GUI: WinSW doesn’t have a graphical interface. All interaction happens through PowerShell or the command line.
  • Service Management: You can manage the service like any other Windows service using sc.exe or the Windows Services Management Console (services.msc).


Basic Service Commands

  • Start Service:
powershell

.\cg-automation-runner.exe start
  • Stop Service:
powershell

.\cg-automation-runner.exe stop
  • Check Status:
powershell

sc query "cg-automation-runner"

With these steps, the CG Automation Runner should now be running smoothly as a service on your Windows Server 2022. The service will also automatically start at boot due to the startmode=Automatic setting in the XML configuration.


Upon a successful run, the Runner Profile on the dashboard will change its status from 'Inactive' to 'Active'.


Run Actions

To use the cg-automation-runner for running actions, follow the process outlined below:


Create Internal Profiles

  • Create internal profiles inside the 'runner' Profile. Internal Profiles are Profiles. We use the name Internal Profile to distinguish these from regular Out of the box Profiles
  • These internal profiles represent different environments or configurations within the customer’s infrastructure.
  • For more details on how to create internal profiles, refer to the Profile Documentation.
  • You can create various type of Profiles under one Runner.


Assign Runner and Internal Profiles in Workflow

  • When creating a workflow, select the created 'runner' profile as the profile.
  • Choose the appropriate internal profile that represents the specific environment where the action will run.


Run Workflow

Run the created workflow. You can refer here for more information.


The specific actions assigned to this runner will be processed, and you can view the results on the Callgoose SQIBS dashboard. Open the incident that triggered the workflow and click on the button labeled "Show Workflow Log". You can find more information from here.


CALLGOOSE
SQIBS

Advanced Automation platform with effective On-Call schedule, real-time Incident Management and Incident Response capabilities that keep your organization more resilient, reliable, and always on

Callgoose SQIBS can Integrate with any applications or tools you use. It can be monitoring, ticketing, ITSM, log management, error tracking, ChatOps, collaboration tools or any applications

Callgoose providing the Plans with Unique features and advanced features for every business needs at the most affordable price.



Unique Features

  • 30+ languages supported
  • IVR for Phone call notifications
  • Dedicated caller id
  • Advanced API & Email filter
  • Tag based maintenance mode

Signup for a freemium plan today &
Experience the results.

No credit card required