User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:manuals:xadmin.8

xadmin

Name

xadmin — Enduro/X Administration command line utility

Synopsis

xadmin [COMMAND] [OPTIONS]

DESCRIPTION

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;

COMMANDS

quit
Quit from command line utility
q
Alias for quit
exit
Alias for quit
echo
Echo text back to terminal
idle
Enter daemon process in idle state (if not started)
help
Print help (this output)
stat
Prints general status information
poller
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.
ldcf
Load configuration
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).
psc
Print services
stop [-y] [-s <server>] [-i <srvid>] [-k] [-f] [-l]
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). When full stop is performed, the Latent Command Framework (LCF) commands are cleared and set to disable. LCF memory is left after the shutdown. If re-reconfiguration of LCF memory segments is required (env setting NDRX_LCFMAX), then run xadmin down and then start the application, it will create shm. If after the shutdown commands shall be kept, then use -l option, it will leave LCF memory as is without setting to disable.
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.
sr
Alias for sreload
psc [-s]
Print available services. -s used to show full service name 30 symbols.
down [-y]
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.
cat
Attached console to ndrxd user session in progress.
reload
Load new configuration. Note that <services> and <routing> tags are reloaded in deferred mode. I.e. changes are applied after certain number sanity cycles have been completed by ndrxd(8). See ndrxconfig.xml(5) tag <endurox>/<appconfig>/<ddrreload>.
testcfg
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.
r
Alias for restart
-v
Print version info.
ver
Alias for -v
ppm [-2]
Print process model. The argument -2 show second page of process model attributes.
psvc [-r]
Shared mem, print services. -r used for System V and Poll modes where resource identifiers are printed (either msgid (for System V) or pid for Poll mode).
psrv
Shared mem, print servers
cabort [-y]
Abort shutdown or startup operation in progress. -y do not ask for confirmation.
sreload [-y] [-s <server>] [-i <srvid>]
Restart servers instance by instance
pq
Print Queue statistics from ndrxd.
pqa [-a]
Print all queues including client and admin Q. -a includes other prefix queues.
pt
Print global transactions in progress.
printtrans
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.
aborttrans
Alias for abort.
commit -t <transaction_manager_reference> -x <XID> [-y]
Commit transaction. -y is for auto confirmation.
committrans
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.
pe
Print Environment variables of ndrxd process.
printenv
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 ENV_NAME
Unset environment variable
pc
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 without 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.
mqlc
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.
mqlq
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.
mqrc
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.
pubfdb
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.
cacheshow
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().
cachedump
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.
cachedump
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.
shms
Shows currently open shared memory segments.
pmode
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.
dsleep SLEEP_SEC
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.
udown [-y]
Remove all System V resources used by user. This includes any of: queues, shared memory and semaphores. -y is used for confirmation.
svqids [-i] [-k]
Print System V queue identifiers allocated for current user. Command outputs Queue identifier and IPC Key. If parameter -i is set, identifier is are printed only. If parameter -k is set, only keys are printed.
svsemids [-i] [-k]
Print System V semaphore identifiers allocated for current user. Command outputs Queue identifier and IPC Key. If parameter -i is set, identifier is are printed only. If parameter -k is set, only keys are printed.
lcf [COMMAND] [-p <PID>] [-b <BINARY>] [-r] [-a] [-n] [-e] [-s <SLOT>] [-A <ARG_A>] [-B <ARG_B>]
This is administrative interface to Latent Command Framework. When command is run without arguments, it prints page 1 information. Build in commands given in COMMAND is -1 (page 1 infos), -2 (page 2 infos), -3 (page 3 infos). Note that statistics printed are not synchronized between processes. Arguments: -p is used for passing PID to command. -b is used to pass binary name to command. -r says that pid or binary name is regular expression to match several processes. -a says that command shall be applied to all application instance binaries. -p, -b, -a are exclusive. -n says that apply command also to new binaries (just started) too. -e says that command shall be applied to new binaries too, but command for new binaries expires after NDRX_LCFCMDEXP time (default 60 sec). -n and -e are incremental and appends default flags of the command. -A is argument to command. -B is argument to command. Enduro/X provided LCF commands are listed bellow. Under this xadmin command new commands might appear if plugins are registering them with ndrx_lcf_xadmin_add(3) API calls.
shmcfg
Command is used to print the shared memory configuration information. The memory segment is the same as for LCF, but these settings are used for other purposes. Values shmcfgver_lcf - LCF command version, incremented with each command publication. use_ddr set to 1 if data-dependent-routing used or per service settings are published. ddr_page - current page number used by settings 0 or 1 as double buffering is used for lock-less operations. ddr_ver1 version number of current DDR setting.
prtsvc
Print routing services from current shared memory page. Flags -a means all slots of linear hash. -i only used slots. -w slots which was in use. By default only used slots are printed.

ENDURO/X LCF COMMANDS

lcf disable
Disable the command at given slot. Default SLOT (-s) is 0. Note by default when instance is started all commands are initialized as disable and are not executed by any binary.
lcf logrotate
Perform logrotate. Default is -a all binaries. And by default -e flag is set, so that if logrotate is issued, and at particular moment some process is forking, so that new process would still be able to connect to new log files, as ones during the fork might be concurrently rotated away. Logrotate reopens any currently open logger file. Note that mkdir and bufsz settings are kept as they were defined at the point when log file was open.
lcf logchg -A <DEBUG_STRING>
Change the logging settings for process logger. The format for DEBUG_STRING is as is defined for ndrxdebug.conf(5) debug configuration. Log facility/topic levels (ndrx, tp, ubf) affects loggers immediately. Also levels are back propagated to thread and request loggers, if those are configured with different level settings. file name can be changed too, but this only affects only process logger output. bufsz and mkdir only affects if file name is changed, or at next file name change / reopen by process logger. Note that FILE handles are shared between threads thus if process is switching to some existing file open by other thread, then bufsz and mkdir is still the same as with already open file.

CONFIGURATION

The following parameters from section [@xadmin] or [@xadmin/<$NDRX_CCTAG>] are used (if config file is present):

gen scripts=PATH_TO_GENERATOR_SCRIPTS
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.

SAMPLE CONFIGURATION

For system wide settings the following file is created: /etc/xadmin.config:

[@xadmin]
gen scripts=/development/templates

EXIT STATUS

0
Success
1
Failure

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd