ctmsca

The ctmsca utility enables you to monitor services through system commands, such as shutting down the environment, starting and ignoring services, and viewing the status of all services in Control-M/Server. The ctmsca utility is a watchdog process for all services and includes system-wide commands that are not dependent on Kafka or any other service. This utility supports operation commands that are only available on the current machine where the command is executed.

Running the ctmsca Utility

This procedure describes how to run the ctmsca utility, which enables you to monitor and send commands for all services such as shutting down, starting, and ignoring services and viewing the status.

Begin

  1. Do one of the following:

    • UNIX: Log in to a Control-M/Server account.

    • Windows: Open a command prompt window where the Control-M/Server is installed.

  2. Type the following command:

    ctmsca <command>

ctmsca Utility Commands

The following table describes the ctmsca commands:

Command

Description

Usage

help

Displays SCA available commands.

ctmsca help <COMMAND>

set-desired-state

Sets the desired state for the service or all services on the local machine.

The desired state is updated in the XML file located in <Control-M/Server_home>/services/desired_state/.

ctmsca set-desired-state [-x] [--all] [-s=<serviceName>] <desired-state>

  • desired-state values:

    • up

    • down

    • ignored

  • [all]: Run command for all services.

  • -s, --service=<serviceName>: The service name targeted by command.

  • -x, --exclude_ignored> : A current desired state with the status ignored does not change when you use the all parameter.

get-desired-state

Receives the desired state of a service.

ctmsca get-desired-state [-s=<serviceName>

  • desired-state values:

    • up

    • down

    • ignored

  • -s, --service=<serviceName>: The service name targeted by the command.

    The get-desired-state function does not accept the -all parameter.

get-current-state

Receives the current state of a service.

ctmsca get current-state [--all] [-s=<serviceName>]

  • desired-state values:

    • up

    • down

    • ignored

  • -s, --service=<serviceName>: The service name targeted by command.

service

Maintains the Services Configuration Agent:

  • Starts a new instance of the Services Configuration Agent .

  • Terminates a current instance of the Service Configuration instance and restarts another Service Configuration instance.

ctmsca service

status

Returns the services state on the current machine.

Retrieved values:

  • rc=0: All services current state matches their desired state.

  • rc=1: All services current states are down.

  • rc=2: At least one service current state does not match its desired state.

  • rc=-1: General error.

ctmsca status

shutdown

Shuts down all services including services-config-Agent (watch-dog).

ctmsca shutdown [-f]

The following examples describe the ctmsca utility in the UNIX environment:

  • To set the help, type the following:

    ctmsca help

  • To set the Apache Kafka desired state to up, type the following:

    ctmsca set-desired-state –s apache-kafka up

  • To set all services desired state to down, type the following:

    ctmsca set-desired-state down --all

The following examples describe the ctmsca utility in the Windows environment:

  • To force the shutdown of all services, type the following:

    ctmsca shutdown –f

  • To send the status command, type the following:

    ctmsca status

  • To run the Services Configuration Agent in service mode, type the following:

    ctmsca service