rc — Aitia Remote CLI
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:
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.
rc is supplied with bash tab completion support for commands and command parameters.
List of available options:
rc offers additional commands over the default command set of the daemon for human readable queries of its states.
Some command (see below) supports globbing in parameter. If glob parameter is omitted, the parameter defaults to match all.
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:
Prints descriptions of config parameters in ascii table format.
Prints values of config parameters in ascii table format.
Shows the help message for the specified remote or rc command. Glob pattern can be used to list help of multiple commands.
name of the command or glob pattern.
(available values: configs.help, configs.print, configs.show, help, info.show, list, vars.help, vars.show)
Lists every available remote and rc command.
name of the command or glob pattern.
(available values: configs.help, configs.print, configs.show, help, info.show, list, vars.help, vars.show)
Prints counter descriptions in ascii table format.
Prints counter values in ascii table format.
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:
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