Can't Remove Userman Logs

Hi All,

I am having a problem with removing userman logs, but when I issue the command

/tools/user-manager/logs/print

/tools/user-manager/logs/remove 1-xxx

I get error time out detected!

I have a total of 219000 entries, and even when I try only do 1-20 it fails.

I have managed to install a script on the other routers, and this works, but when I add to this one in particular it also fails.

We are opperating RB532 with ROS2.9.46 on the board that is having problems!

Any help in getting this sorted out will be greatly appreciated.

Im at 198,000 this is starting to become a bit of a problem. anyone?

What I ended up doing is to backup mikrotik, clear to factory settings and re-install all my settings.

Then added a script which deletes logs.

CLEAR USERMAN LOG SCRIPT:

:local Flag
:set Flag [/tool user-manager log find]
:if ([:len $Flag] > 0) do={/tool user-manager log print append file log;/tool user-manager log remove [/tool user-manager log find];}

This will however not be a problem for us anymore as we are moving onto radius manager soon. Hopefully this does not occur on radius manager. It also has an easy setup for account management. the mikrotik emplementation is not that great. But works when the scripts are setup correctly.

Hope this helps.

SO i can literally copy and paste the script right? no editing required?

thanks mate, its a shame its come to this.

Yes you can copy paste the script into script window:

Start → Do Not Copy This

:local Flag
:set Flag [/tool user-manager log find]
:if ([:len $Flag] > 0) do={/tool user-manager log print append file log;/tool user-manager log remove [/tool user-manager log find];}


End → Do Not Copy this

Another script that is usefull is this one

Clear-Userman-Sessions

Start–>Do Not Copy This

:local Flag
:set Flag [/tool user-manager session find]
:if([:len $Flag]>0) do={/tool user-manager session print; /tool user-manager session remove [/tool user-manager session find];}

End -->Do Not copy this

I set both to run on every 5 days!

Hi,
i have the same problem - running unsermanager on a RB600 with damn small harddiskspace.
I’v ~ 800.000 entries in the logs.
I ran the above script but except of the fact that the CPU goes up to 100% nothing seems to happen.

Is there a way to get rid of the database and logs all x days to prevent the harddisk from running full ?

Greetz
Heiko

Anything new concerning this issue ?

Regards
Heiko

do you have a scheduler on this running every day or what? -Jordan

I Have the same problem, my hard disc is full and i cannot remove the logs either from user-manager either with the scripts
i run routeros 3.11 in x86 anyone can help this issue?
nothing seems to fix this issue… and i do not know if a upgrade to 3.13 will fix this problem.

concerning the changelog, nothing new was added to the usermanager.
i guess, there is no possibility to clear the logs.

Logs management will be improved in the new improved User Manager, which will be released soon.

To delete the UM logs try:

:local Flag
:set Flag [/tool user-manager log find]
:if ([:len $Flag] > 0) do={/tool user-manager log remove [/tool user-manager log find];}

To export to file then delete UM logs try:

:local Flag
:set Flag [/tool user-manager log find]
:if ([:len $Flag] > 0) do={/tool user-manager log print append file log;/tool user-manager log remove [/tool user-manager log find];}

Hello,

i have installed the script, but the logs can´t remove.
The usermanager-log has 2 million (!!!) entries in the log and the database is getting bigger every day.
After 15h with 100% cpu-load (P4 2.4GHz, 512MB), I canceled the script.
The radius-server must be disabled before I start the script?
(ROS V3.30)

Regards

When I executed the scripts in winbox, they didn’t run. But they did the job when executed via CLI. You may want to try that if you haven’t already.

I have startet the script in CLI. How long does the deletion of log files? I stopped after 2 h with 100% CPU load.

when it will be soon??

it have past now like nearly 2 years and nothing is changed… :angry: :angry: :angry: :angry: :angry: :angry: :angry:

my session are still growing and growing and I CAN’T DELETE THEM !!! i have try’d manuali to delete im http://local_ip/userman but it dosent work..!!!

p.s.
i have a rb 411 and im runnig v4.3

can someone help me

tnx
bye

  1. What do you have in tool user-manager router print configuration.
    Make sure you are not logging information, which is not necessary for you.

[admin@MikroTik] /tool user-manager router> print

Flags: X - disabled
0 customer=administrator name=“test”
ip-address=127.0.0.1
shared-secret=“test” log=auth-fail
coa-port=1700

it is enough to log only auth-fail.

  1. Note, that when you launch the command to remove the logs, you might see that timeout from console, but it does not mean that logs are not being remove. You need to wait 10-15 minutes (perhaps logs will be removed after this time).

the problem is that i dont log anythig..
and the log’s are not so much problem like the sessions…

i have 0 log’s (userman) but i have like 2000 session in 1 day…and my hdd space is limited to 32mB (rb 411 that have 64mB total) and every few day it smaller and smaller and i don’t now how to delete all sessions at one’s and i can’t see any option to autmatic delete the session..


my suggestion is for next user manager pls put some time scheduler in it..so that when it reach like 5000 sessions that the last one’s delete automatic..

or can you tell me some script that will automatic delete like every 10 day’s all seasons??
i use v4.3


tnx for replay
bye

try this script to delete all UM logs :

:foreach i in=[/tool user-manager log find] do { /tool user-ma
nager log remove $i; }

thanks a lot… the script works very fine !!!

If you want delete the session, only change two words: