如何同时连接多个mikrotik?

How connect to multiple mikrotik at the same time?

我不知道如何同时使用 routeros-client 创建多个 api 到 microtics 的连接(我有超过 20 个)。 是否有可能以某种方式将配置与参数和凭据连接起来?我很乐意接受任何建议和提示

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

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

问题是这样解决的: 首先创建 config.yml,然后定义变量并使用 forEach() 方法。

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