emsca

The emsca 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. It is a watchdog process for services, which is monitored by the Control-M/EM Configuration Agent. Although you can use the services-cli utility for some commands, use this utility if you want to include 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 sent.

Running the emsca Utility

This procedure describes how to run the emsca utility, which enables to monitor and send commands for all services such as shutting down, starting and ignoring services, viewing the status and setting the log level, etc. It is a watchdog process for all services, which is monitored by the Control-M/EM Configuration Agent, but is not dependant on Kafka or any other service.

Begin

  1. Do one of the following:

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

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

  2. Type one of the following commands:

    • UNIX:em emsca <command>

    • Windows:emsca <command>

emsca Commands

The following table describes the emsca commands when running the emsca utility:

Command

Description

Usage

help

Displays SCA available commands

emsca help <COMMAND>

set-desired-state

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

The desired state is updated in the yml file located in <EM_HOME>/services/desired_state/

emsca set-desired-state [--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

service

Starts the Services Configuration Agent in a service mode

emsca service

status

Returns the services state on current machine.

Retrieved values:

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

  • rc=1: All services current state is down

  • rc=2: At least one service's current state doesn't match its desired state

  • rc=-1: General error

emsca status

shutdown

Shutdown all services including services-config-Agent (watch-dog) by running the following:

  • UNIX: ‘kill -15 <PID>’

  • Windows: ‘wmic process <PID> delete’

To force shutdown by killing all remaining processes:

UNIX: ‘kill -9 <PID>’

emsca shutdown [-f]

emsca Examples

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

  • To see the help, type the following:

    em emsca help

  • To set set the protocol-translator's desired-state to ignored, type the following:

    em emsca set-desired-state ignored –s protocol-translator

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

    em emsca set-desired-state down --all

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

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

    emsca shutdown –f

  • To send the status command, type the following:

    emsca status

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

    emsca service