Mikrotik 脚本 - 所有 table 列

Mikrotik Script - all table columns

我正在尝试让脚本 运行 每天通过电子邮件发送最近激活的用户列表。我找不到可以列出我在 userman 'Users' 屏幕中看到的内容的命令。

我需要每天为昨晚激活的几个用户触发一个脚本。 这些在用户管理器中显而易见,但是如果您在终端中键入 "/tool user-manager user print" 它只显示连接到 winBox 的管理员用户!!不是用户管理器中的最终用户。另一方面,如果您键入“/ip hotspot active”,但这只会向我显示活跃用户,而不是我想要的视图。 问题:在用户管理器中向用户显示所有有用信息(如配置文件、开始时间等)的正确 command/script 是什么?

经过大量研究,无法通过 api 或 mikrotik 终端命令访问 table 中的列。必须直接使用驱动程序访问 SQL,例如 SQLite3 或类似的驱动程序。

首先将用户屏幕的内容打印到一个文件中:

/ip hotspot user print file="users.txt"

然后将其通过电子邮件发送到您想要的任何邮箱:

/tool e-mail send file="users.txt" to=xxx@xxx.com subject="user list" body="hello\nthis is an automated message"

您可以使用 detail 标志:

/ip hotspot user  print detail

您可以使用 where 闭包过滤内容:

/ip hotspot user  print detail where profile=users-x limit-uptime>20m

保存在文件中:

/ip hotspot user  print file="info_users-x.txt" detail where profile=users-x