Skip to content
Snippets Groups Projects
Commit d8e66b0f authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update docs

parent 340f42bc
Branches
No related tags found
1 merge request!2update docs
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment