Hello,
I’m having a problem with a mikrotik(RB1100AHx2 v6.34.2) installation (a hotspot with internal radius and user manager)
I’ve assigned the customer profile to the comment field so everyday this script re-assigns the user-profiles.
Each profile has a validity period of 23h55m starting with now.
The scripts runs as scheduled at 12:00 everyday
:log info "Starting reset script"
:local username
:local profile
:local customer
:foreach i in [/tool user-manager user find] do={
:set username [/tool user-manager user get $i username]
:set profile [/tool user-manager user get $i comment]
:set customer [/tool user-manager user get $i customer]
:log info ("Will set $profile to $username for $customer")
/tool user-manager user create-and-activate-profile $username customer=$customer profile=$profile
}
This somewhat works and every user is assigned a new profile. With every passing day the user profile should change status to Used and a new profile is activated.
But i have 2 major problems.
1st) When i browse to user details and toggle all profiles, i can see all the profiles. One as active and every previous one as paused. If i go and manually assign (from the user manager www) a profile to a user and then go an check each user’s details, all previous profiles are correctly changed to Used. From my understanding, assigning a user profile via script does not refresh the web interface (even with page refresh).
(I’ve got mixed reports whether this visual representation affects the actual enforced limits. When i try/use it, it works as expected, when the client’s users use it, they sometimes go over time limit.)
2nd) What happens to the used profiles? Do they stay assigned to the user forever? Do they clean up automatically or is there any way to clean them up? I imagine having 365 used profiles in a user’s details is not practical.
Bonus problem: There is no way to view the all user’s assigned profiles from cli. This goes back in the forums forever
Bonus problem 2: The actual-profile is not being refreshed/emptied from cli. Even when the profile’s limits are reached and the profile is being removed from the account, the last active profile remains as actual-profile.
My previous script used to clean-counters and only assign profiles to users without actual-profile (!actual-profile). But since actual-profile never clears up, this was not working.
The story behind this installation:
What my client wants is a > daily > uptime limit for each user/room. The user/room cannot be deleted/recreated due to the requirement of keeping the session logs on a yearly basis. This is absolute and cannot be skipped.In user manager i’ve got over 150 users, each user representing a room.
I’ve also have 4 different profiles. Each profile has an uptime limit varying from 3 to 8 hours.
Each user has one profile assigned on a daily basis.