MT-bulk v2.3.1 Mikrotik automate and send mass commands +REST API

Hi,

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.

You can download binary releases for Windows(64bit), Linux (32/64bit) and Mac OSX (64bit) from https://github.com/migotom/mt-bulk/releases
Documentation and source code at: https://github.com/migotom/mt-bulk/blob/master/README.md

Keep in mind that development is still and progress, feel free to report any issues or ideas at https://github.com/migotom/mt-bulk/issues

Last release: 2.3.1 https://forum.mikrotik.com/viewtopic.php?f=9&t=145850#p848961

How about Windows version ?

I checked and it seems to be written in go so I think it’s possible to adapt the source code for windows too or Just boot a Linux VM

That’s right. I just prepared version for windows, please test it. https://github.com/migotom/mt-bulk/releases/download/v1.1/mt-bulk.1.1.windows.amd64.zip
Latest release always at https://github.com/migotom/mt-bulk/releases

released version 1.2:

  • dropped OpenSSL dependency

released version 1.3:

  • added sleep attribute to commands, e.g. sleep = “100ms” (required by some ros commands)

released version 1.4:

  • improved SSH sessions handling (better performance and fix for passing additional user input to commands, e.g. passing password)
  • added checking for new releases (can be disabled by switch --skip-version-check)

released version 1.5 https://github.com/migotom/mt-bulk/releases/tag/v1.5

  • option to load custom SSH/API commands from separate config files by --commands-file= argument
  • better error handling and returning error code 1 on any error.

Any plans for MacOS version?

There is already MacOS version https://github.com/migotom/mt-bulk/releases/download/v1.5/mt-bulk.1.5.darwin.amd64.zip

Released version 2.0

https://github.com/migotom/mt-bulk/releases

New features:

  • 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)
  • internal code major refactor

Looks promising, I will give it a try. One request, can you post a simple yaml config file. It will give me a flying start.

You have sample configurations in https://github.com/migotom/mt-bulk/tree/master/examples/configurations

Including yaml and toml versions.

PS. Let me know if anything is unclear or missing some examples.

Thanks

Released 2.1

https://github.com/migotom/mt-bulk/releases/tag/v2.1

New features:

  • added system backup operation
  • added sftp operation
  • added simple file server to mt-bulk-rest-api (JSON response includes download_urls for operations like SystemBackup)

Changes:

  • configurable root_directory for mt-bulk-rest-api
  • documentation improvements (including more examples)
  • fixes in parsing SSH output for some Mikrotik devices
  • removed version check errors presenting
  • minor fixes

Released 2.2

https://github.com/migotom/mt-bulk/releases/tag/v2.2

New features:

  • new operation - scan for known vulnerabilities (CVE) and perform security audit
  • added mt-bulk internal key/value based database (used to cache CVE search results and information about new mt-bulk releases)
  • added configurable CVE search API endpoints
  • added option to define in custom ssh/api mode multiple matches for regex parsers of executed commands

Minor changes and fixes:

  • fixed returning multiple errors
  • fixed automatically creating not existing but configured paths
  • fixed paths parsing
  • improved internal tests
  • improved documentation
  • compiled with Go 1.13.3

Released 2.2.2

https://github.com/migotom/mt-bulk/releases

Minor changes and fixes:

  • fixed/improved detecting of enabled unsecure services
  • added presenting CVE details and reference URLs (both for CLI and RESTlike API)
  • error handling regression fix

Released 2.2.3

https://github.com/migotom/mt-bulk/releases

Minor changes and fixes:

  • fixed strong crypto ssh support for new RouterOS versions
  • fixed ssh support for some edge cases
  • fixed low memory hosts support
  • yaml configuration format fixes

Since last post released 2.3 and 2.3.1

https://github.com/migotom/mt-bulk/releases

New features:

  • Added support for parsing hosts from The Dude CSV exports (thanks @tyler-sommer )

Fixes:

  • Fixed #13 (Try next IP on “can’t resolve host x.x.x.x”) by skipping unresolvable hosts
  • Fixed #15 (new API login method)
  • Fixed error message could occur during certificates creation

.