Menu

COMMAND_RCMD

Carlos Celso de Almeida

Return HOME or USAGE

Name

rcmd - Parallel Remote Command based SSH Command

Description

This tool was created to remotely execute commands on distributed
systems from a local catalog database. The local catalog consists on
local database that you can add users tag and probe system attributes.
Theses tags will be assigned on the nodes and can used to match and
searches.

The tool is only available for SSH protocol based Unix and Linux
Systems.

NOTE: The SSH keys of the host (sender) must be previous loaded on the
clients.

Caution

 CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION
 CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION
 CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION

 This module will send and execute commands for all matched clients.

 Sending unexpected commands you can DESTROY or COMPROMISE this nodes.

 i.e: "rebooting all clients", "removing files of all clients", etc.

 Use wisely.

 CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION
 CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION
 CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION --- CAUTION

Usage

 rcmd [command] [options] [nodelist]

Commands

 -list   list cataloged nodes
 -píng   send icmp packets
 -probe  get node's system information
 -run    send commands to run (default command, if not required)
 -test   send simpley dummey command, where 'dummy command' is 'simple echo shell command'

Options

The options depend on the command operation. They can be:

-attempts [value]

     number of retry until abort
     default: 3 (run, test and probe) or 1 (ping)

-command-file [fullpath-script-file]

         script command file to run

-config [fullpath-config-file]

     config file
     default: /etc/rcmd.d/rcmd.conf

-debug [module1]:[level1],[module2]:[level2],...

     enable debug mode
     default: no debug enabled

     module  description
     ------  ---------------------------------------------------
     all     debug all levels (not recommended)
     cmd     action to do
     lib     external functions
     call    callback functions
     plugin  plugin calls
     sql     commands
     ------  ---------------------------------------------------

     level  tracking description
     -----  ----------------------------------------------------
     1      module start/completed
     2      module stage1
     3      module stage2
     4      module stage3
     5      module stage4 or sql callbacks
     6      module stage5 or sql where
     7      module stage6 or sql command
     8      inputs
     9      returns
     -----  ----------------------------------------------------

    CAUTION: The tracking sql module or inputs or returns may expore
    Login/Passord SQL

-description
     show default help information

-detail
     show node fields split into rows

-examples
     show examples in help context

-fields [field1,field2,...]
     show specific tags (options, users or system) fields.

     see: show-options, show-system and show-tags

-help|?
     this help

-ignorelist [node1,node2]
     list of node to be ignored.

-inactive
     list inactive nodes.
     Default: list only active nodes (enabled or errors state).

    NOTE: inactive nodes are deprecated in the system. Use inactive
    status to keep the nodes as history information.

-index
     add sequence counters for each received node's message

-license
     show license aggrement

-maxthreads [value]
     number of concurrent threads
     beware: a large number of threads may cause DoS on your client.
     default: 64

-node-status [value]
     select only enabled node (non-enabled will be ignored)
     status  description
     ------  --------------
     1       disabled
     2       enabled
     3       ns_error
     4       refused
     5       probe_error
     6       no_response
     9       unknown

     others non-indexed messages

     no_match     Node not mapped
     pipe_error   Module pipe fork error

     NOTE: use '-node-status 0' to shown all.

-nodelist [node1,node2,...]
     list of nodes

-noheaders
     suppress headers summaries and briefings

-nonode
     ignore the first word as nodelist information, where the nodelist is defined by '-nodelist' option.
     the '-nodelist' options is required

-nop|non-iteractive
     non iteractive execution command and supress approve question

-notitle
     suppress title text, only results will be sent

-output [fullpath-stdout-file]
     write stdout as file
     default: standard output file

-options [opt1],[opt2] or -options [opt1] -options [opt2]
     select nodes based options tags added by user.
     you can specify multiple tags options

     to list node with any tag use: -option '*'

-ping-command [fullpath-ping-command]
     ping fullpath command
     default: /usr/bin/ping

-show-nonprobe
     show non-probe message sent by the node

-show-noresponse
     show no response nodes messages

    NOTE: The 'no_response' cannot be an error. If the commands sent
    complete without STDOUT messages, it will give the status
    'no_response'.

-show-options|sop
     show extended node options.

-show-rc
     show return code for each node's closed connection

-show-system|ss
     show system tags

     see: System Attributes

-show-tags|st
     show users tags

     see: Users Tags

-ssh-cipher|sc [specs]
     Selects the cipher specification for encrypting the session.
     cipher_spec is a comma-separated list of ciphers listed in order of preference.
     See the Ciphers keyword in "man ssh_config" for more information.

-ssh-command [fullpath-ssh-command]
     ssh fulpath command
     default: /usr/bin/ssh

-ssh-enable-tty
     Enable pseudo-terminal allocation.
     Defaults: is disabled, see '-T' option in "man ssh"

-ssh-login [default-user-login]
     default ssh user connection
     default: current user login session

-ssh-logwarn
     show ssh warn messages
     default: only error messages

     NOTE: To enable ssh warning messages as default sets "/etc/rcmd.d/rcmd.conf":

     set ssh_logwarn 1

-ssh-options|so [ssh-option] ...
     additional ssh option (ssh option '-o')
     default: no additional options will be used

-ssh-port [value]
     TCPIP port number
     default: 22

-ssh-private-key|ssh-key [ssh-key]
     private ssh keys
     default: current user using '.ssh' folder

-stderroff
     suppress stderr messages

-stdoutoff
     suppress stdout messages

-summarize
     sumarize common block messages

     NOTE: Do not use this option for large buffer response. You may require large memory to do.

-system [s_tag1],[s_tag2] or -system [s_tag3] -system [s_tag4] ...
     select nodes based system tags mapped by the probe process.
     you can specify multiple system options

     see: System Attributes

     to list nodes with some tag use: -system '*'

-tags [u_tag1],[u_tag2] or -tags [u_tag3] -tags [u_tag4] ...
     select nodes based users tags added by user.
     you can specify multiple tags options

     to list nodes with some tag use: -tags '*'

-time-exec [value]
     forced command abort due to command execution timeout.
     sets the maximum time in seconds to execute the command.
     defaults: 0 (zero - unlimited time)

     BEWARE: Forced abort is only local and may causes broken pipe connection,
     where remote commands can continue to execute without returning any results.

-time-grace [value]
     sets the maximum waiting time for the abortion process to complete.
     defaults: 5 seconds

     NOTE: The abort process has already been submitted and cannot be interrupted.

-time-probe [value]
     forced command abort due to probe execution timeout.
     sets the maximum time in seconds to execute the probe.
     defaults: 10 seconds

     BEWARE: Forced abort is only local and may causes broken pipe connection,
     where remote commands can continue to execute without returning any results.

-timeout [value]
     number of seconds on the timeout option
     default: 10

-tracking
     shown tracking informantion each 60 secs

-use-sudo
     enforce SUDO command, required for scripts with evelation without 'root login'.

     NOTE: The SUDO command is auto detect for non-users, is not required.

-version
     show current command verion

-wait
     show node's buffer after completed
     default: the messages will be sent to stdout option as they are received

     NOTE: Do not use this option for large buffer response. You may require large memory to do.

-with-node-options
     enable node options feature
     default: enabled

     You can add on /etc/rcmd.d/rcmd.conf to enable by default

     set NODE_OPTIONS 1

     see: -without-node-options

-with-status
     select node with specific status in catalog.

     NOTE: Do not use this topns for large buffer response. You may require large memory to do.

-without-noanswer-notify
     suppresses the 'noanswer' notification sent at the end of the rcmd process.

         no_match
         no_response

-without-node-options
     disable node options feature
     default: enabled

     You can add on /etc/rcmd.d/rcmd.conf to disable by default

     set NODE_OPTIONS 0

     see: -with-node-options

Nodelist

 The 'nodelist' consists of the list of nodes that will be affected,
 it can be in the following format:

 1) Nodes separed by spaces.

 # rcmd ... node1 node2 node3

 2) Nodes separed by comma.

 # rcmd ... node1,node2,node3

 3) Nodes separed by spaces and/or comma.

 # rcmd ... node1,node2 node3,node

 4) Nodes by match mask.

 # rcmd ...  node*  *node  no*de

 node*    prefixed
 *node    sufixed
 no*de    middle

The match mask can be applied on 'node names', 'users' and 'systems'
tags

Tags

The users and system tags consists addition information to locate a
specific list of nodes.

Users Tags

The user's tags consists in pseudo information that you can add for the
nodes. This is a useful feature to identify a group of nodes, like:
Production, Q&A, Developer, PoC, Application Names, etc.

We highly recommended assigning user's tags to create affinity node
groups.

System Attributes

System attributes can not be added through the command user interface,
they are automatically detected by the 'probe' command on 'rcmd' or
'rcmdmgnt'

the following list of system attributes will be mapped by default during
the PROBE process. These attributes can be used in the 'rcmd' command as
'nodes' location arguments. they are:

 system-id      description
 -------------  --------------------------------------------
 hostname:      hostname information
 arch           HW Archtecture
 class:         unix, windows, etc
 cpu:           Total core
 core:          Number of core per socket
 dist:          Distribution name
 hardware:      bare, vmware, kvm, etc
 kernel:        Kernel version
 machineid:     Machineid
 manufactor:    HW Vendor
 memory:        RAM in KB
 product:       HW Product
 platform:      32 or 64 bit
 sn:            SerialNumber
 socket:        Number of sockets
 system:        AIX, Solaris, Linux, etc
 threads:       Number of threads per core
 update:        Kernel level
 vendor:        Distribution vendor
 version:       Distribution version
 -------------  --------------------------------------------

NOTE: The Linux Distribuitions will be classified as 'class=unix' and
'system=linux' and the distribuition name will be sets on the
'dist=distname'.

NOTE: The field 'sn' (serial number) is user-defined information. The
system operation receives this information based on the BIOS and/or
platform initialization. In most scenarios, this information must be
normalized by customers to establish the real value.

ENDED


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.