Page 1 of 1

Mikrotik Mass Update

Posted: Thu Mar 23, 2023 10:40 am
by rollopack
I've released a script to update (or send other commands) to a Mikrotik list via SSH.
The script builds on work already done by Phillip Hutchison and Kevin Byrd.

https://github.com/rollopack/MikroTik-Mass-Updater/

Re: Mikrotik Mass Update

Posted: Fri Nov 10, 2023 10:38 am
by rollopack
Released v2.0
Now use Parallel::ForkManager to speed up operations

Re: Mikrotik Mass Update

Posted: Wed Dec 11, 2024 5:21 pm
by rollopack
Version 3.0.1 - Python rewrite

- Output grouped by host: Results are grouped by host, both on-screen and in the log file.
- Colored output (optional): The on-screen output can be colored for better readability, highlighting hosts, commands, output, and errors. Colors can be turned on or off with the --no-colors command-line option.
- Log file: The commands and their corresponding output are saved in a log file.
- Threading: Uses threads for faster execution.
- Improved error handling: The script now handles and reports errors in more detail.

Re: Mikrotik Mass Update

Posted: Fri Dec 13, 2024 9:52 am
by rollopack
Version 4
Migrated from SSH to API

Re: Mikrotik Mass Update

Posted: Mon Feb 17, 2025 7:26 pm
by Phunny
first i like the mass updater . but i don't get the glue about custom commands
a simple command works, but i don't get a command like
/user add name=xxxxxx password=yyyyyyy group=read
working
what is the form i have to enter that in the array ?
i miss an example in the documentation ;)

Re: Mikrotik Mass Update

Posted: Tue Feb 18, 2025 10:13 am
by rollopack
Thanks for the feedback.
v4.4 is out with improved custom commands
---
The custom_commands array in the script supports two types of commands:

1. Simple commands - Just the command string:
   '/interface/print'
   
2. Commands with parameters - A tuple containing the command and a dictionary of parameters:
   ('/user/add', {
       'name': 'newuser',
       'password': 'userpass',
       'group': 'read'
   })
   
Example of custom_commands array:
custom_commands = [
    # Simple command
    '/system/clock/print',
    
    # Command with parameters
    ('/user/add', {
        'name': 'monitor',
        'password': 'secret123',
        'group': 'read'
    }),
    
    # Another simple command
    '/user/print'
]
Note: Parameters must match the exact names expected by the MikroTik API for that command.