I wrote simple tool for friend’s company to help managing many Mikrotik devices. Maybe for some of you this tool will be helpful as well.
MT-bulk allows to fast and asynchronous distribute commands to Mikrotik devices (collected from file, database or just command line) using both SSH and SSL API.
REST API gateway server mt-bulk-rest-api listening for HTTPS requests with type of job/operation to perform on specified host.
All request are distributed to worker pool of configurable amount of workers, to avoid race condition request for same IP addresses are always passed to same worker.
REST API gateway authenticate request by tokens generated using configurable keys with customized authorization rules.
Auth token is valid one hour
added support for public key SSH authentication
added configurable SSH pty
added YAML configuration format (since 2.0 YAML is default format but TOML is still supported)
added option to load hosts using toml/yml files with declared credentials per host
Changes:
change password operation, added optional user name parameter
SSH responses parser fixes (eg. filtering non ASCII characters)
added obsolete SSH key exchanges (needed by some older Mikrotik devices, still recommended to upgrade them)
added support for RouterOS strong-crypto (/ip ssh set strong-crypto=yes)
improved mt-bulk execution output
added configurable connection attempts/retries with increasing backoff time
better concurrency model of dividing jobs to workers
moved most of command line flags into configuration
reorganized examples and documentation
redesigned configuration structure (please be aware that configuration from versions 1.x will not work anymore)