-1

I'm trying to have a script run daily that would email the list of recently activated users. I cannot find a command that would list what i see in userman 'Users' screen.

I need to fire a script daily of the couple of users that got activated last night. Those are clearly obvious in user-manager however if in the terminal you type "/tool user-manager user print" it only shows the admin user connected to winBox!! not the end users in user-manager. On the other hand, if you type "/ip hotspot active " but this only shows me the active users now not the view i want. QUESTION: What is the proper command/script to show users in user-manager with all the good info like Profile, start-time etc??

devsahem
  • 83
  • 3
  • 15

3 Answers3

0

After much research, the columns in the table are not accessible through the api or the mikrotik terminal command. One has to access the SQL directly using drivers suc has SQLite3 or such .

devsahem
  • 83
  • 3
  • 15
0

First print the content of the Users screen to a file:

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

Then e-mail it to whatever mail you want:

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

you can use the detail flag:

/ip hotspot user  print detail

You can use the where closure for filter content:

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

Saving in a file:

/ip hotspot user  print file="info_users-x.txt" detail where profile=users-x
fitorec
  • 4,257
  • 2
  • 24
  • 18