Community discussions

MikroTik App
Forum rules
Only MikroTik related software is allowed. No bumping of topics, no spam, no unrelated or vaguely related tools.
 
rollopack
just joined
Topic Author
Posts: 11
Joined: Wed Oct 17, 2018 1:21 pm

Mikrotik Mass Update

Thu Mar 23, 2023 10:40 am

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/
 
rollopack
just joined
Topic Author
Posts: 11
Joined: Wed Oct 17, 2018 1:21 pm

Re: Mikrotik Mass Update

Fri Nov 10, 2023 10:38 am

Released v2.0
Now use Parallel::ForkManager to speed up operations
 
rollopack
just joined
Topic Author
Posts: 11
Joined: Wed Oct 17, 2018 1:21 pm

Re: Mikrotik Mass Update

Wed Dec 11, 2024 5:21 pm

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.
 
rollopack
just joined
Topic Author
Posts: 11
Joined: Wed Oct 17, 2018 1:21 pm

Re: Mikrotik Mass Update

Fri Dec 13, 2024 9:52 am

Version 4
Migrated from SSH to API
 
Phunny
just joined
Posts: 1
Joined: Thu Aug 29, 2024 2:47 pm

Re: Mikrotik Mass Update

Mon Feb 17, 2025 7:26 pm

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 ;)
 
rollopack
just joined
Topic Author
Posts: 11
Joined: Wed Oct 17, 2018 1:21 pm

Re: Mikrotik Mass Update

Tue Feb 18, 2025 10:13 am

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.