How connect to multiple mikrotik at the same time?

365 Views Asked by At

I can't figure out how to create more than one api connection to microtics (I have more than 20 of them) using routeros-client at the same time. Is it possible to somehow connect a config with parameters and credentials? I will be glad to any advice and tips

const RouterOSClient = require('routeros-client').RouterOSClient;

const api = new RouterOSClient({
host: '',
user: '',
password: '',
})
1

There are 1 best solutions below

0
sdvjke On BEST ANSWER

Problem solved in such way: Firstly there was created config.yml, then defined variables and use forEach() method.

const yaml_config = require('node-yaml-config');
const config = yaml_config.load(__dirname + '/config/host.yml');