|
4 | 4 | [](https://github.com/hellt/cmdo/releases/) |
5 | 5 | --- |
6 | 6 |
|
7 | | -Commando is a tiny tool that enables users to collect command outputs from a single or a multiple networking devices defined in an inventory file. |
| 7 | +Commando is a tiny tool that enables users |
| 8 | +* to collect command outputs from a single or a multiple networking devices defined in an inventory file |
| 9 | +* send file-based or string-based configs towards the devices defined in the inventory file |
| 10 | + |
| 11 | +all that with zero dependencies and a 1-click installation. |
8 | 12 |
|
9 | 13 | [](https://asciinema.org/a/417792) |
10 | 14 |
|
@@ -157,13 +161,50 @@ devices: |
157 | 161 | address: string |
158 | 162 | credentials: string # optional reference to the defined credentials |
159 | 163 | transport: string # optional reference to the defined transport options |
| 164 | + send-commands-from-file: /path/to/file/with/show-commands.txt |
160 | 165 | send-commands: |
161 | | - - cmd1 |
162 | | - - cmd2 |
163 | | - - cmdN |
| 166 | + - cmd1 |
| 167 | + - cmd2 |
| 168 | + - cmdN |
| 169 | + send-configs-from-file: /path/to/file/with/config-commands.txt |
| 170 | + send-configs: |
| 171 | + - cmd1 |
| 172 | + - cmdN |
| 173 | + cfg-operations: |
| 174 | + # Note: cfg operations currently supported only on: arista_eos, cisco_iosxe, |
| 175 | + # cisco_nxos, cisco_iosxr, juniper_junos |
| 176 | + - type: load-config |
| 177 | + replace: false |
| 178 | + diff: true |
| 179 | + commit: false |
| 180 | + # Note: there is also a "config-from-file" option to load configurations from a file |
| 181 | + config: "interface loopback1\ndescription tacocat" |
| 182 | + - type: get-config |
| 183 | + source: running |
164 | 184 | ``` |
165 | 185 |
|
166 | | -`send-commands` list holds a list of commands which will be send towards a device. Check out the attached [example inventory](inventory.yml) file to a reference. |
| 186 | +`send-commands` list holds a list of non-configuration commands which will be send towards a device. A non configuration command is a command that doesn't require to have a configuration mode enabled on a device. A typical example is a `show <something>` command. |
| 187 | +Outputs from each command of a `send-commands` list will be saved/printed. |
| 188 | + |
| 189 | +If you want to keep the commands in a separate file, then you can use `send-commands-from-file` element which takes a path to a said file. You can combine `send-commands` and `send-commands-from-file` in a single device. |
| 190 | + |
| 191 | +In contrast with `send-commands*` options, it is possible to tell `commando` to send configuration commands. For that we have the following configuration elements: |
| 192 | + |
| 193 | +* `send-configs` - takes a list of configuration commands and executes then without printing/saving any output the commands may return |
| 194 | +* `send-configs-from-file` - does the same, but the commands are kept in a file. |
| 195 | + |
| 196 | +Entering in the config mode is handled by commando, so your config commands doesn't need to have any `conf t` or `configure private` commands. Just remember to add the `commit` command if your device needs it. |
| 197 | + |
| 198 | +The order these options are processed in: |
| 199 | + |
| 200 | +1. "cfg" operations |
| 201 | +2. send-configs-from-file |
| 202 | +3. send-configs |
| 203 | +4. send-commands-from-file |
| 204 | +5. send-commands |
| 205 | + |
| 206 | + |
| 207 | +Check out the attached [example inventory](inventory.yml) file for reference. |
167 | 208 |
|
168 | 209 | ## Configuration options |
169 | 210 |
|
|
0 commit comments