sga-rc — Aitia Remote CLI
sga-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.
sga-rc is supplied with bash tab completion support for commands and command parameters.
List of available options:
sga-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 sga-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.
sga-rc shipped with a bash profile file containing various sga-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/sga-rc-profile.sh
Note: for permanent use add this line to ~/.bashrc.
Available bash functions:
Listing all running aitia demons:
sga-rc --list
The command above will output a list like this, marking the currently selected daemon for sga-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:
~& sga-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:
sga-rc -i 2 sga-rc -a 16002 sga-rc -n db1
The selection change can be suppressed with the -s/--nosel option:
sga-rc -i -s 2 sga-rc -a -s 16002 sga-rc -n -s db1
When a daemon is selected, sga-rc can be used to control the daemon.
Checking the whole configuration, part of it or individual parameters:
sga-rc configs.show sga-rc configs.show "**" sga-rc configs.show writer.** sga-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:
sga-rc vars.show sga-rc vars.show msg.**
Replacing an input channel:
sga-rc process.stop sga-rc io.close in input1 sga-rc io.open in socket-adg://123.45.67.89:18000 sga-rc process.start
Saving the states and closing the daemon:
sga-rc process.stop sga-rc state.save /home/sga/msgwriter.db1.tar sga-rc app.quit
Json handling in io.open (in rc config file space is not supported):
sga-rc -a 16002 io.open in http2-avro://127.0.0.1:12345?resp='{"foo":"foo"}'