diff --git a/docs/10_Introduction b/docs/10_Introduction index c54509eb78655cbadb9a7754e21bc5f23a49760f..4da2a31fd8b3964ae9b3098f261a02f622077f87 100644 --- a/docs/10_Introduction +++ b/docs/10_Introduction @@ -3,6 +3,8 @@ Multi SSH shellscript written in Bash to execute a single command on one or many target hosts via ssh. A target host can define a jumphost if it is not accessible directly. +The initial purpose was to make system updates on many servers with a visualisation which server was updated successfully / already and which not. + The script is designed to run in interactive mode but supports a few command line parameters for scripting too. In a server configuration file you can put your servers. Each server can have diff --git a/docs/40_Usage.md b/docs/40_Usage.md index cf66c76fb738b8c133c0556d07c90aef037905af..53882cc9b4c8f9c1280339053dbca52c45cc4ac6 100644 --- a/docs/40_Usage.md +++ b/docs/40_Usage.md @@ -20,6 +20,20 @@ Server list: * last success - timestamp of the last execution of the set command with exitcode 0. If the field is empty the command was not executed yet. This field helps you to see if a command was executed on all servers alreadyor not. * Running - Info for curently running job or fisnished job and the terminal window is still open. If it is empty then the job is not running +```txt + Server Bastion (20 chars) last success Running + 1 www.example.com + 2 db.example.com + : + +Special commands: + ':c' change command hostname -f + ':t' change tags tue + ':p' change profile iml +Enter numbers or parts of servernames. Use space as divider. +Just press return to update server infos amd running status. +> +``` Behind the prompt you can type an action and press Return. @@ -71,9 +85,63 @@ Mark it with the mouse and paste it with middle mouse key. In the menu enter a single number - or multiple numbers separated by space. +#### Prepare + The current commad will be started on the given host in an extra terminal window. +The terminal to open can be configured, eg gnome-terminal or konsole. + +see ../config/userconfig.sh - `export MRE_TERMINAL=<appname>` + +A given ssh user will connect to the target host. + +see ../config/userconfig.sh - `export MRE_SSHUSER=<sshuser>` + +#### Execute + +When the terminal window started you see starting time, the executed statement followed by the output of the command. + +As long the command is running you will see `TERM` in the server list. + +```text +>>>>> List of servers - Fri Nov 1 13:13:55 CET 2024 + + Server Bastion (20 chars) last success Running + 1 www.example.com TERM + 2 db.example.com +``` + +#### On finish + +If the command is finished you get a line with finishing time and command. +In the last line you see + +* "OK" on exitcode 0 +* "ERROR" on non zero exitcode + +The finished execution is tracked in `logs/returncodes.log` + +If the command is `hostname -f`to be executed on www.example.com: + +```text +Fri Nov 1 13:13:49 CET 2024 START ssh admin@www.example.com hostname -f ... +_______________________________________________________________________________ + +www.example.com +_______________________________________________________________________________ +Fri Nov 1 13:13:49 CET 2024 END ssh admin@www.example.com hostname -f +>>> OK >>> Press RETURN to exit +``` + +In the server list a successful execution is shown: + +```text +>>>>> List of servers - Fri Nov 1 13:14:09 CET 2024 + + Server Bastion (20 chars) last success Running + 1 www.example.com 13:13:49 + 2 db.example.com +``` -see ../config/userconfig.sh - `export MRE_TERMINAL=gnome-terminal` ## CLI usage