diff --git a/docs/40_Usage.md b/docs/40_Usage.md index 82c9498275159352798e1671731945ef12775aa0..cf66c76fb738b8c133c0556d07c90aef037905af 100644 --- a/docs/40_Usage.md +++ b/docs/40_Usage.md @@ -2,6 +2,80 @@ Just start `multi_ssh.sh` - it will initialize a user config file with the defaults. Without a parameter you reach the interactive mode. +It supports cli parameters too. + +## Interactive usage + +### Server menu + +If you start the script, then you get a list of your servers. +The list of servers is can be filtered with one or more tags. +You can switch to another profile to see another set of servers. + +Server list: + +* Number - starting with `1` +* Server - servername +* Bastion (20 chars) - jumphost to connect; it is empty if the server is connected directly +* 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 + + +Behind the prompt you can type an action and press Return. + +Possible actions: + +* `:c` change command to execute on all servers +* `:t` change tags +* `:p` change profile +* A single number - or multiple numbers separated by space: The current commad will be started on the given host in an extra terminal window + +### Change command + +After `:c` you get a list of config/commands.txt + all commands.txt in the profile directory for the current profile `config/<profile>/commands.txt`. This list helps you to pick a predefined action like maintenenace, backup, reboot, whatever. + +You see the current command. +In the prompt enter the new command. + +Just return keeps the current command. + +Hint: + +Mark it with the mouse and paste it with middle mouse key. + +### Change tag + +After `:t` you get a list of all tags that are defined in your server configuration. + +Enter tags to filter hosts; seprate mulitple tags with space (from given list) + +Just return keeps the current tags(s). + +Hint: + +Mark it with the mouse and paste it with middle mouse key. + +### Change profile + +After `:p` you get a list of all configured profiles. + +Enter a prfile to switch too. + +Just return keeps the current tags(s). + +Hint: + +Mark it with the mouse and paste it with middle mouse key. + +### Execute the current command + +In the menu enter a single number - or multiple numbers separated by space. + +The current commad will be started on the given host in an extra terminal window. + +see ../config/userconfig.sh - `export MRE_TERMINAL=gnome-terminal` + +## CLI usage To see the parameters start `multi_ssh.sh -h`