xadmin − Enduro/X Administration command line utility
xadmin [COMMAND] [OPTIONS]
xadmin is command line interface to Enduro/X. It is administration utility. Which is servers as communication interface between Enduro/X ATMI local daemon and administrator. xadmin can receive commands as parameter to xadmin. It can read command from pipe (stdin). And it can work in interactive mode. In this case xadmin is started with no parameters.
xadmin is responsible to start idle instance of ndrxd. After that xadmin sends commands to ndrxd and prints the response from daemon to the stdout in human readable form. Commands are sent and response from ndrxd are received via POSIX Queues.
xadmin can lookup the configuration (currently used for user specific generators). The configuration search order is following:
1. INI file by NDRX_XADMIN_CONFIG environment variable. This can also be a directory. The common−config routines will load all configs (.ini .cfg, .conf, .config) files.
2. INI file in $HOME/.xadmin.config;
3. INI file in /etc/xadmin.config;
Quit from command line utility
Alias for quit
Alias for quit
Echo text back to terminal
Enter daemon process in idle state (if not started)
Print help (this output)
Prints general status information
Print polling sub−system name i.e. epoll − when build is using Linux e−poll sub−system, this allows true one queue multiple server approach to be used. kqueue − the same benefits as for Linux epoll only on BSD platform, SystemV − for this build System V queues are used (instead for others Posix queues are used). In case of System V still one queue multiple servers are available with configuration of request address. poll − this is worst mode for Enduro/X as only Round Robin message distribution is available for dispatching messages to servers. This uses only standard features of Posix queues. The poller is built in the distribution and cannot be changed via configuration, only possible changing is with reinstalling other Enduro/X build.
start [−y] [−s <server>] [−i <srvid>]
Start application domain. If config not loaded, it loads configuration automatically. −y means do not ask for confirmation. −s means ATMI servers binary name to be started, instead of whole application domain. −i means start specific server instance. In case if ndrxd(8) was busy with other session tasks (other terminal start/stop or internal server reload on limited memory use), the xadmin will re−attempt to send message to ndrxd before giving up. The number of attempts are configured in NDRX_NORMWAITMAX environment variable (default is 60), between attempts 1 second sleep is done. see ex_env(5).
stop [−y] [−s <server>] [−i <srvid>] [−k] [−f]
Stop application domain. −y means do not ask for confirmation. −s means ATMI servers binary name to be stopped, instead of whole application domain. −i means stop specific server instance. −k flag will keep ndrxd running, and protected servers will not be shutdown. In case if ndrxd(8) process is doing start or stop for other xadmin session (or doing internal server reloads in case if memory limits reached), then command will perform several re−attempts for executing the command. The attempts are configured in NDRX_NORMWAITMAX environment variable. Between attempts, 1 second sleep is done. In case if stop command was unable to send message to ndrxd, command will exit with failure, and will not wait for ndrxd termination. In case if −f force flag is set, the xadmin will wait indefinitely until ndrxd will not be found in the system. No matter message was sent to ndrxd or not. see ex_env(5).
sreload [−y] [−s <server>] [−i <srvid>]
Reload application domain − restart server instance by instance. Configuration be loaded prior. −y means do not ask for confirmation. −s means ATMI servers binary name to be reloaded, instead of whole application domain. −i means restart specific server instance.
Alias for sreload
Print available services.
Force appserver shutdown & resources cleanup. RUN ONLY IF YOU KNOW WHAT YOU ARE DOING! Basically this kills all ATMI servers and Enduro/X daemon. This does NOT remove client processes.
Attached console to ndrxd user session in progress
Load new configuration
Test new configuration
unadv −i server_id −s service_name
Un−advertise service. −i is server id, −s is service name to be unadvertised.
readv −i server_id −s service_name
Re−advertise service. Might be usable if service Q was unlinked. −i is server id, −s is service name to be re−advertised.
restart [−y] [−s <server>] [−i <srvid>]
Restart app or service (invokes start & stop with same args!). −y makes to not to ask for confirmation. −s is server/binary name. −i is server ID.
Alias for restart
Print version info
Alias for −v
Print process model. The argument −2 show second page of process model attributes.
Shared mem, print services
Shared mem, print servers
Abort shutdown or startup operation in progress. −y do not ask for confirmation.
sreload [−y] [−s <server>] [−i <srvid>]
Restart servers instance by instance
Print Queue statistics from ndrxd.
Print all queues including client and admin Q. −a includes other prefix queues.
Print global transactions in progress.
Alias for pt.
abort −t <transaction_manager_reference> −x <XID> [−g <resource_manager_id>] [−y]
Abort transaction. −g does abort single resource manager’s transaction. −y is for auto confirmation.
Alias for abort.
commit −t <transaction_manager_reference> −x <XID> [−y]
Commit transaction. −y is for auto confirmation.
Alias for commit.
recoverlocal [−s <TM SERVICE>]
List local/for each TMSRV heuristic in−doubt transactions. This makes query to RM with xa_recover. With −s flag specific TMSRV service can be specified. otherwise all visible TMSRV servers are queried.
commitlocal [−s <TM SERVICE> [−x <XID>]] [−y]
Commit in−doubt transaction. If −x xid reported by recoverlocal is not specified, then all transactions are tried to be committed. If −s is set then specific TMSRV instance service is queried. If −x is set, −s must be set too, because specific XID must be part of some specific instance. The status of particular operation is reported back to stdout. Note that only prepared transactions can be processed by this command. Heuristically committed/aborted transaction may be only forgot. If so, context errors may be given.
abortlocal [−s <TM SERVICE> [−x <XID>]] [−y]
Abort in−doubt transaction. If −x xid reported by recoverlocal is not specified, then all transactions are tried to be aborted. If −s is set then specific TMSRV instance service is queried. If −x is set, −s must be set too, because specific XID must be part of some specific instance. The status of particular operation is reported back to stdout. Note that only prepared transactions can be processed by this command. Heuristically committed/aborted transaction may be only forgot. If so, context errors may be given.
forgetlocal [−s <TM SERVICE> [−x <XID>]] [−y]
Abort in−doubt transaction. If −x xid reported by recoverlocal is not specified, then all transactions are tried to be forgotten. If −s is set then specific TMSRV instance service is queried. If −x is set, −s must be set too, because specific XID must be part of some specific instance. The status of particular operation is reported back to stdout.
Print Environment variables of ndrxd process.
Alias for pe.
set ENV_NAME=ENV VALUE
Set environment value. The value of env variable is parsed as command line arguments. Prior sending to ndrxd they are concatenated with spaces in between.
Unset environment variable
Print client processes. This sends command to Client Process Monitor server (cpmsrv).
bc −t <process_tag> [−s <sub_section>] [−w <wait_time>]
Boot client process. This sends command to Client Process Monitor server (cpmsrv). Processes are registered in ndrxconfig.xml<clients> section. If sub section is not specified, then default value is minus sign (−). The process_tag and sub_section can contain wildcards percent (%) sign. Then boot process will be executed in batch mode and progress will be returned to the xadmin’s output. When running in batch mode wait_time is time in milliseconds to sleep after each matched process is marked for start. Note that wait_time shall be less than global timeout specified in NDRX_TOUT env variable (or cconfig [@global] section).
sc −t <process_tag> [−s <sub_section>] [−w <wait time in milliseconds>]
Stop client process. This sends command to Client Process Monitor server (cpmsrv). The process is stopped by process_tag and optional sub_section. If sub section is not specified, then default value is minus sign (−). The process_tag and sub_section can contain wild−card percent sign (%), then stopping is executed in batch mode (stop all matched running processes). If wait_time is specified then in batch mode it is sleep in milliseconds after each stopped process. Note that wait_time shall be less than global timeout specified in NDRX_TOUT env variable (or cconfig [@global] section). Also time needed for stopping shall be counted in. If the timeout occurs, cpmsrv will complete the operation anyway.
rc −t <process_tag> [−s <sub_section>] [−w <wait time in milliseconds>]
Reload client process. This sends command to Client Process Monitor server (cpmsrv). The process is reloaded (stopped/marked for start) by process_tag and optional sub_section. If sub section is not specified, then default value is minus sign (−). The process_tag and sub_section can contain wild−card percent sign (%), then reloading is executed in batch mode (stop/start running processes one by one). If wait_time is specified then in batch mode it is sleep in milliseconds after each stopped process. Note that wait_time shall be less than global timeout specified in NDRX_TOUT env variable (or cconfig [@global] section). Also time needed for stopping shall be counted in. If the timeout occurs, cpmsrv will complete the operation anyway. The wait_time can be used in cases when reloading the binaries with out service interruption, in that case wait_time should contain the cpmsrv’s interval check time (−i flag) because for start operation binary is only marked for boot and not the booted. Basically this executes sc/bc for each of the matched processes.
List queue configuration. This broadcasts the requests of config listing to all tmqueue servers. If flags column contains D flag, then it means that queue was dynamically defined and QDEF string contains values from default queue.
List actual queues allocated on system. Similarly as for mqlc this requests the information from all tmqueue servers. #LOCK column contains the number of active non committed messages in Q. #SUCC and #FAIL column contains number of processed messages for automatic queues (messages are sent to destination services automatically by tmqueue server.
This command requests all queue servers to reload the configuration file.
mqlm −s <QSpace> −q <QName>
List messages in queue. −s is queue space name (set by tmqueue−m paramemter). The output lists the message ID in modified base64 version (/ changed to _).
mqdm −n <Cluster node id> −i <Server ID> −m <Message ID>
Dump/peek message to stdout. The values from −n (node id), −i (srvid), −m(message id) can be taken from mqlm command. This command prints to stdout, the TQCTL structure in form of UBF buffer and the message it self. If message is UBF, then UBF dump is made, otherwise hexdump of message is printed.
mqch −n <Cluster node id> −i <Server ID> −q <Q def (conf format)>
Change/add queue defnition to particular tmqueue server. The format of the queue definition is the same as used q.conf(5) (see the man page). You may miss out some of the bits (except the queue name). Those other bits will be take from default q.
mqrm −n <Cluster node id> −i <Server ID> −m <Message ID>
Remove message from queue. You have to identify exact queue space server here by Enduro/X cluster id and server id.
mqmv −n <Source cluster node id> −i <Source server ID> −m <Source Message ID> −s <Dest qspace> −q <Dest qname>
Move the message from specific qspace server to destination qspace and qname. The bits from TPQCTL which are returned by tpdequeue() call are preserved in new tpenqueue() call. Note that for this call xadmin must be in invalid XA environment, so that distributed transaction can be performed.
killall <name1> [<name2> ... <nameN>]
Kill all processes given by ps −ef. The command does match the name in the line. If substring is found, then process is killed.
qrm <qname1> [<qname2> ... <qnameN>]
Remove specific Posix queue.
qrmall <substr1> [<substr2> ... <substrN>]
Remove queue matching the substring.
provision [−d] [−v<param1>=<value1>] ... [−v<paramN>=<valueN>]
Prepare initial Enduro/X instance environment, create folder structure, generate configuration files with ability to register all available services.
gen [−d] [−v<param1>=<value1>] ... [−v<paramN>=<valueN>]
Generate application sources. See the xadmin’s help for more details. Currently it is possible to generate C and Go sources and the UBF buffer headers for both languages. By running the command, wizards will be offered asking for different details. Which later can be reconfigured by −d − allowing to default the wizard, while −v allows to set wizard values from command line.
Print UBF custom fields database contents to the terminal.
cs <cache_db_name>|−d <cache_db_name>
Print cache contents (headers) to the terminal. The database name is specified in cache_db_name parameter.
Alias for cs.
cd −d <dbname> −k <key> [−i interpret_result]
Dump specified message to the terminal. With specified −i flag, the attempt for data interpretation will be made. For UBF buffers the output will be formatted with command Bprint().
Alias for cd.
ci −d <dbname> [−k <key>][−r use_regexp]
Invalidate cache. In case if only −d is specified, whole database will be dropped. Exact record may be dropped with −k flag. In case if −r is used, then key will be matched as regular expression over the data keys. In case if drop database is used, linked keygroup records are not processed. For other scenarios, linked records are processed according to the configuration.
Alias for cd.
svmaps [−p] [−s] [−a] [−i] [−w]
Command is available only for System V messaging sub−system. Command prints the Queue ID (same ids from ipcs command) mappings to Posix queues used by Enduro/X. −p parameter (which is enabled by default) prints the mapping table from Posix Queue to System V. −s parameter uses reverse table by printing System V mappings to Posix. −a enables to print all the entries in the shared memory (there could be lots of lines printed. Totally set by NDRX_MSGQUEUESMAX environment variable). −i (used by default) prints only the queues which currently are in use. −w prints mappings which were in use, but currently are not in use. The −i, −w arguments can be combined.
Shows currently open shared memory segments.
Prints technical information about Enduro/X build mode (basically ndrx_config.h).
ps [−a filter] [−b filter] [−c filter] [−d filter] [−r regexpfilter] [−p] [x pid]
Print running processes in system with command line arguments. This is similar to ps −ef in Linux or equivalents on other Operating Systems. Enduro/X ps command does not print the xadmin process, it is filtered out by default. The flags −a, −b, −c and −d are just a words that must be substring for the the ps output (i.e. basic grep). The −r argument is regular regular expression that must be matched. If none of these arguments are passed, then no filtering is done and max output is done (except the xadmin by it self). To enable printing PID only, use −p argument. To exclude particular PID from printing, use −x argument. The memory stats in kilobytes can be printed with turning on argument −m which must be used together with −p, then output is printed in format: "<pid>:<RSS>:<VSZ>", where RSS and VSS memory is printed in Kilobytes.
appconfig SETTING [NEWVALUE]
Change ndrxconfig.xml(5) "appconfig" section arguments dynamically for the process running. Settings available for changing are sanity, checkpm, brrefresh, restart_min, restart_step, restart_max, restart_to_check, gather_pq_stats and rqaddrttl. For their descriptions and possible values see ndrxconfig.xml(5) manpage. The syntax for command is that if NEWVALUE is not provided, then current value is printed. If NEWVALUE is provided, then value is changed and new value is printed to stdout. ndrxd must be running (or will be started in idle state). Note that configuration must be loaded in order to have non−error output from command.
dping [−c <loops>]
Perform ndrxd pings By default 4 loops are done, but this can be overridden by −c argument.
Put ndrxd in sleep mode, this is useful for debugging. Number of seconds to sleep are denoted in SLEEP_SEC argument.
mibget [−c <CLASS>] [−m]
This returns lists the tm_mib(5) objects in command line. The object classes are set in −c argument, where possible values are T_CLIENT, T_DOMAIN, T_MACHINE, T_QUEUE, T_SERVER, T_SERVICE, T_SVCGRP and T_BRCON. The parameter −m returns the output in machine readable format.
Remove all System V resources used by user. This includes any of: queues, shared memory and semaphores. −y is used for confirmation.
The following parameters from section [@xadmin] or [@xadmin/<$NDRX_CCTAG>] are used (if config file is present):
This parameter configures the path where xadmin should look for .pscript files. The file names must be in following format: gen_<lang>_<type>.pscript. Basically <lang> and <type> will be offered as targets under $xadmin gen command. The $xadmin help will print these scripts. For script reference look in Enduro/X source code, xadmin/scripts folder. It is assumed that these scripts will inherit WizardBase class compiled into Enduro/X. This class is driving the wizard. Also note that each parameter which is asked to user enter into wizard, can be overridden from command line with −v<param1>=<value1>. The generator can be defaulted by −d argument.
For system wide settings the following file is created: /etc/xadmin.config:
Report bugs to firstname.lastname@example.org
© Mavimax, Ltd