Admiral Platform Fleet Commander provides the ability to run a command line operation or script that will execute on one or many MikroTik routers. All output from the routers is captured for display, allowing for creative use of the tool for various purposes.
Uses include: #
- Bulk configuration changes
- Finding a mac or IP address
- Troubleshooting a path problem by triangulation with traceroute
- Checking to see if a configuration option is enabled
- Enabling a configuration option on some/all routers
Requirements #
- Routers must have appropriate user permissions
- Router must be online
- SSH service must be enabled on the router
- Command must be a valid Router OS command
Run Command or Script #
Getting started is as simple (screenshot below).
- Select individual routers or select all.
- Fill in Job Title and Command and click the Run Command button.
- Choose between running the command Now or schedule it to run in the future.
Multi-Command Jobs #
Fleet Commander works by sending a single command at a time to a device. This means that special precautions must be taken for running multiple commands at once.
Separating Commands #
- All commands must be separated with a semicolon (;)
- A trailing semicolon is optional
- Line breaks are optional, but do NOT separate commands. Only Semicolons separate commands, line breaks are only visual.
- Depending on rOS version, you may need to lead every command with a forward slash (/)
- Correct:
- /ip address print;/ip arp print;/ip route print;
- /ip address print;
/ip arp print;
/ip route print
- /ip address print;/ip arp print;/ip route print;
- Incorrect:
- /ip address print /ip arp print /ip route print
- /ip address print
/ip arp print
/ip route print- These will not run because they are missing semicolons. Due to how commands are sent to the MikroTik, these commands cannot be correctly parsed and will be incorrectly read as 1 long command.
- /ip address print /ip arp print /ip route print
- Correct:
Script Path/Change Directory #
- Since each command is sent individually, directory changes are not persistent between commands.
- This means the full command path MUST be included with every line for it to work correctly.
- Correct:
- /system logging add action=EX123 prefix=Critical topics=critical;/system logging add action=EX123 prefix=Info topics=info,!firewall;/system logging add action=EX123 prefix=Warning topics=warning;/system logging add action=EX123 prefix=Error topics=error;
- /system logging add action=EX123 prefix=Critical topics=critical;
/system logging add action=EX123 prefix=Info topics=info,!firewall;
/system logging add action=EX123 prefix=Warning topics=warning;
/system logging add action=EX123 prefix=Error topics=error;
- /system logging add action=EX123 prefix=Critical topics=critical;/system logging add action=EX123 prefix=Info topics=info,!firewall;/system logging add action=EX123 prefix=Warning topics=warning;/system logging add action=EX123 prefix=Error topics=error;
- Incorrect:
- /system logging
add action=EX123 prefix=Critical topics=critical
add action=EX123 prefix=Info topics=info,!firewall
add action=EX123 prefix=Warning topics=warning
add action=EX123 prefix=Error topics=error- This command will fail for multiple reasons. First, there are no semicolons so the command will be parsed as one long command. Line breaks do NOT separate commands. Second, each command is sent individually, so “/system logging” will only be present with the first command. The MikroTik will not know what to do with the remaining commands
- /system logging
- Correct:
Additional Considerations #
- Logs will only be written to your Admiral if the script returns data.
- This means a set command likely will not return data, while an export or print command will.
- Fleet Commander jobs are executed from top to bottom.
- If a command fails, the fleet commander job will be interrupted. Any completed portions will be written to logs but the rest of the job will not be attempted.
- If you are running into issues with a larger job, print commands can be used to troubleshoot and see how far the command made it before failing.
Save Common Commands #
- Create new command with a unique title and the intended command.
- Check box below command text area
- Once you run the command the saved job will populate in the ‘Select Saved’ Jobs field where you can easily run your common commands.
Delete Saved Jobs #
Delete previously saved jobs.
- Select desired ‘Saved Job’ from drop down list
- Double check you have selected the correct job to delete, as this process cannot be reversed.
- Select the red delete button to the right of the drop down and confirm deletion
Logs #
How to View Output (screenshot below)
- Select the blue View Logs button to go to the listing of logs.
- Click on the clipboard icon to view or the arrow icon to download as a text file
Warning!! #
Please use caution. It’s not recommended to use set, disable or remove commands. #
- Fleet Commander will run a command on one or many of your routers.
- Before running fleet commander, verify commands on one unit first.
- RWB is not responsible for any damages caused by executing set, disable or remove commands.