Name

rc — Aitia Remote CLI

Synopsis

rc COMMAND

rc [OPTIONS] COMMAND

rc [OPTIONS]

instancename COMMAND

DESCRIPTION

rc is a tool for sending control commands - one at a time - to Aitia daemons. The tool waits for the daemons' response and prints it on standard output, or on standard error in case of receives error message.

Target daemon should be selected on first use or in case of targeting different daemon as targeted for last call. The application stores selected daemon for subsequent calls. Running daemons can be listed using the remote listing options. The daemon can be selected by either:

  • IP address and port, however the port alone is sufficent for local addresses;
  • instance name, which is deduced from the daemon config file name;
  • or by ID, which is the adhoc ID assigned for the listed daemon. The ID is not permanent, it can change in case of any handled daemon exits or starts.

OPTIONS

Command consists of one or more tokens separated by whitespace. This command will be sent to the daemon. For the list of available commands send list command to the daemon.

Note

rc is supplied with bash tab completion support for commands and command parameters.

List of available options:

COMMAND
command to be sent to the selected daemon
-l, --list
list available daemons
-a, --address
select daemon by IP address:port or port
-i, --id
select daemon by id from daemon list
-n, --name
select daemon by instance-name
-h, --help
print this help
-v, --version
print version number
-b, --bash
print bash code of aliases for running daemons
-j, --jsondoc
print documentation in json format

COMMANDS

rc offers additional commands over the default command set of the daemon for human readable queries of its states.

Note

Some command (see below) supports globbing in parameter. If glob parameter is omitted, the parameter defaults to match all.

Note

If a glob pattern matches any file in the actual folder, bash will expand it before forwarding it to rc. To prevent this, use quotes around the glob pattern or use the supplied bash profile (see below).

List of available commands:

configs.help <Counter>

Prints descriptions of config parameters in ascii table format.

<Counter>
config name or glob pattern
configs.print
Prints active config in RC file format.
configs.show <Counter>

Prints values of config parameters in ascii table format.

<Counter>
config name or glob pattern
help <Command>

Shows the help message for the specified remote or rc command. Glob pattern can be used to list help of multiple commands.

<Command>

name of the command or glob pattern.

(available values: configs.help, configs.print, configs.show, help, info.show, list, vars.help, vars.show)

info.show
Returns general application info in ascii table format.
list <Command>

Lists every available remote and rc command.

<Command>

name of the command or glob pattern.

(available values: configs.help, configs.print, configs.show, help, info.show, list, vars.help, vars.show)

vars.help <Counter>

Prints counter descriptions in ascii table format.

<Counter>
counter name or glob pattern
vars.show <Counter>

Prints counter values in ascii table format.

<Counter>
counter name or glob pattern

BASH PROFILE

rc shipped with a bash profile file containing various rc related features for bash in the form of bash functions. In a login shell it will be loaded automatically by bash. In a non-login shell, the profile can be loaded manually with the following command:

source /etc/profile.d/rc-profile.sh

Note: for permanent use add this line to ~/.bashrc.

Available bash functions:

rc
The profile defines a wrapper around rc command where the bash glob expansion is switched off preventing bash to expand file names for glob patterns in rc command parameters intended to parsed by the daemon instead.
rc-prompt
Changes the bash prompt to show the name of the selected daemon instance, which rc will send the command for.
rc-update-aliases
Generates separate bash aliases for rc targeting each available daemons as shown on the last usage version. The alias name will be the daemons' instance name. This enables a more convenient way to use rc for a permanent daemon setup.

EXAMPLES

Listing all running aitia demons:

rc --list

The command above will output a list like this, marking the currently selected daemon for rc with an asterisk (*):

Remotes:
 * 0. PID12003 127.0.0.1:16001 msgwriter (db0)
   1. PID12060 127.0.0.1:16002 inetasm (inet4pfcp)
   2. PID12076 127.0.0.1:16003 msgwriter (db1)

Setting the prompt to show the selected daemon:

~& rc-prompt
~ (db0)&

Changing the currently selected daemon can be achived by either using the list number, the address or the user specified instance name. The following commands are selecting the same instance:

rc -i 2
rc -a 16002
rc -n db1

When a daemon is selected, rc can be used ot control the daemon.

Checking the whole configuration, part of it or individual parameters:

rc configs.show
rc configs.show "**"
rc configs.show writer.**
rc configs.show writer.data.path

Note: the glob pattern is quoted in the second example because if the actual folder is not empty, bash will expand it to the file list of the folder.

Listing all or a subset of the counters:

rc vars.show
rc vars.show msg.**

Replacing an input channel:

rc process.stop
rc io.close in input1
rc io.open in socket-adg://123.45.67.89:18000
rc process.start

Saving the states and closing the daemon:

rc process.stop
rc state.save /home/sga/msgwriter.db1.tar
rc app.quit

BUGS

Report bug at http://tsplab.hu/redmine.

COPYING

Copyright © 2020 Aitia International Inc.