Community discussions

MUM Europe 2020
 
User avatar
winagain
Member Candidate
Member Candidate
Topic Author
Posts: 244
Joined: Sat Jul 15, 2006 10:18 pm
Location: Botswana
Contact:

Can't Remove Userman Logs

Sun Jan 20, 2008 11:14 pm

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.
 
Jrslick22
Member Candidate
Member Candidate
Posts: 167
Joined: Sun Feb 06, 2005 3:25 am

Re: Can't Remove Userman Logs

Sat Feb 16, 2008 11:03 am

Im at 198,000 this is starting to become a bit of a problem. anyone?
 
User avatar
winagain
Member Candidate
Member Candidate
Topic Author
Posts: 244
Joined: Sat Jul 15, 2006 10:18 pm
Location: Botswana
Contact:

Re: Can't Remove Userman Logs

Sat Feb 16, 2008 12:36 pm

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.
 
Jrslick22
Member Candidate
Member Candidate
Posts: 167
Joined: Sun Feb 06, 2005 3:25 am

Re: Can't Remove Userman Logs

Tue Feb 19, 2008 11:58 am

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.
 
User avatar
winagain
Member Candidate
Member Candidate
Topic Author
Posts: 244
Joined: Sat Jul 15, 2006 10:18 pm
Location: Botswana
Contact:

Re: Can't Remove Userman Logs

Tue Feb 19, 2008 2:33 pm

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!
 
heiko_s
newbie
Posts: 40
Joined: Tue Jul 10, 2007 10:02 am
Location: germany

Re: Can't Remove Userman Logs

Fri Jun 20, 2008 11:03 pm

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
 
heiko_s
newbie
Posts: 40
Joined: Tue Jul 10, 2007 10:02 am
Location: germany

Re: Can't Remove Userman Logs

Thu Jul 10, 2008 10:59 am

Anything new concerning this issue ?

Regards
Heiko
 
User avatar
jordantrx
Long time Member
Long time Member
Posts: 505
Joined: Tue Oct 23, 2007 8:58 pm
Location: WAY upstate NY

Re: Can't Remove Userman Logs

Thu Jul 10, 2008 4:19 pm

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!
do you have a scheduler on this running every day or what? -Jordan
~Agricultural WISP "ZONE"~ Beware of oncoming cattle and dont hit the farmer!!! I need to ask him about using his silo for an AP first"~

*Automated Billing Installer* http://wiki.mikrotik.com/wiki/AutomatedBilling Built by Krige ;-)
 
kourkoulis
just joined
Posts: 2
Joined: Sat Jun 02, 2007 10:03 am

Re: Can't Remove Userman Logs

Thu Aug 14, 2008 9:09 pm

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.
 
heiko_s
newbie
Posts: 40
Joined: Tue Jul 10, 2007 10:02 am
Location: germany

Re: Can't Remove Userman Logs

Fri Aug 15, 2008 2:26 pm

concerning the changelog, nothing new was added to the usermanager.
i guess, there is no possibility to clear the logs.
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6621
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Can't Remove Userman Logs

Mon Aug 18, 2008 9:32 am

Logs management will be improved in the new improved User Manager, which will be released soon.
 
User avatar
airstream
Member Candidate
Member Candidate
Posts: 188
Joined: Fri Feb 03, 2006 6:33 am
Location: New Zealand

Re: Can't Remove Userman Logs

Mon Aug 18, 2008 11:32 am

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.
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];}
Keep tryin' its bound to work!!
-----
-----
ROOT@COSMOS> Reality.sys corrupted -- Reboot Universe (Y/N)?
>_
 
digital-steve
just joined
Posts: 3
Joined: Thu Mar 20, 2008 11:43 am

Re: Can't Remove Userman Logs

Thu Dec 03, 2009 9:51 am

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
 
eneimi
Member
Member
Posts: 388
Joined: Sun Sep 09, 2007 12:55 pm

Re: Can't Remove Userman Logs

Sat Dec 05, 2009 4:47 pm

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.
 
digital-steve
just joined
Posts: 3
Joined: Thu Mar 20, 2008 11:43 am

Re: Can't Remove Userman Logs

Tue Dec 08, 2009 9:44 am

I have startet the script in CLI. How long does the deletion of log files? I stopped after 2 h with 100% CPU load.
 
new_one
just joined
Posts: 15
Joined: Sun May 25, 2008 1:59 am

Re: Can't Remove Userman Logs

Tue Dec 08, 2009 7:22 pm

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

when it will be soon??

it have past now like nearly 2 years and nothing is changed... :-x :-x :-x :-x :-x :-x :-x

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
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6621
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Can't Remove Userman Logs

Wed Dec 09, 2009 10:47 am

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.

2) 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).
 
new_one
just joined
Posts: 15
Joined: Sun May 25, 2008 1:59 am

Re: Can't Remove Userman Logs

Wed Dec 09, 2009 8:43 pm

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
 
ipans
just joined
Posts: 1
Joined: Fri Feb 12, 2010 6:29 am

Re: Can't Remove Userman Logs

Fri Feb 12, 2010 6:33 am

try this script to delete all UM logs :
:foreach i in=[/tool user-manager log find] do { /tool user-ma
nager log remove $i; }
 
petrucci2
just joined
Posts: 2
Joined: Wed Jul 11, 2007 2:12 pm
Location: Valencia, Venezuela

Re: Can't Remove Userman Logs

Fri Apr 23, 2010 6:44 am

try this script to delete all UM logs :
:foreach i in=[/tool user-manager log find] do { /tool user-manager log remove $i; }

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

If you want delete the session, only change two words:
try this script to delete all UM sessions :
:foreach i in=[/tool user-manager session find] do { /tool user-manager session remove $i; }
 
adilazzubaidi
Frequent Visitor
Frequent Visitor
Posts: 79
Joined: Tue Dec 04, 2007 8:13 am

Re: Can't Remove Userman Logs

Fri Apr 23, 2010 10:15 am

use this script
/tool user-manager database clear-log
 
Gareth
Frequent Visitor
Frequent Visitor
Posts: 76
Joined: Sat Apr 24, 2010 7:45 am
Location: South Africa

Re: Can't Remove Userman Logs

Sat Apr 24, 2010 8:31 am

use this script
/tool user-manager database clear-log
I get the following error when i try that:
bad command name clear-log (line 1 column 29)
 
Gareth
Frequent Visitor
Frequent Visitor
Posts: 76
Joined: Sat Apr 24, 2010 7:45 am
Location: South Africa

Re: Can't Remove Userman Logs

Wed Apr 28, 2010 5:13 pm

I've tried all the methods mentioned above. None of them work. The CPU sits at 100% for hours, no one can log in (RADIUS server not responding) and when I finally abort the script, I find that absolutely nothing, not even 1 log entry has been deleted.

The only way I've managed to delete them is via user manager's web interface. I've removed 27,000 so far, but I can only do it 100 at a time because there is so little drive space left that it causes errors when I try to delete 500 or 1000. This method is EXTREMELY time consuming and it also causes users not to be able to log in. Not only that, but I still haven't managed to free up any space. Does anyone know why? Surely there must be an easier way??

Why can't the log be kept in a separate file, visible in Winbox's file list, that can then be easily deleted.
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6621
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Can't Remove Userman Logs

Tue May 11, 2010 1:31 pm

Thank you for the suggestion about saving logs to file.
/tool user-manager log remove [find] should remove the logs, even when it reports timeouts to the console.

You can modify /tool user-manager router and disable unused logging topics, which will saves log space very efficiently,
I'm talking about log=auth-fail in /tool user-manager router
 
User avatar
polokus
newbie
Posts: 35
Joined: Fri Dec 23, 2005 7:04 am

Re: Can't Remove Userman Logs

Wed May 12, 2010 6:07 am

is it possible to move the userman database to a separate harddrive? anyone can point me to the right direction?
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6621
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Can't Remove Userman Logs

Wed May 12, 2010 8:36 am

Yes, it is possible.

Make database backup to be sure (of having backup for emergency),
then copy User Manager store file to the secondary disk,
/store copy user-manager to=secondary_disk_name.
 
User avatar
polokus
newbie
Posts: 35
Joined: Fri Dec 23, 2005 7:04 am

Re: Can't Remove Userman Logs

Wed May 12, 2010 2:52 pm

Already done that but the harddrive already full only left 1mb so cannot store the usermanager database (*.umb), when i try to copy to new harddrive (using store copy) it says error timeout and a suggestion to contact mikrotik support with attached supout.rif (which i did).
any other ways to workaround this? btw the user-manager log already set to minimum which is only logs failed attempt.
 
trevorlc1234
just joined
Posts: 19
Joined: Tue May 25, 2010 8:46 am

Re: Can't Remove Userman Logs

Thu Jun 03, 2010 5:40 am

I found these two scripts to work nicely.
I first tried the ones listed above, the one to remove userman logs and place a export of the file in the root directory called log.txt worked. but the cut and pastes for removing user sessions did not. I dug through the script that I cut and pasted from this forum and found some errors with missing spaces etc. So this is what I have and what is working for me.

Create 2 script's in Winbox

1. Called "Clear_Userman_Logs_Send_to_Log_txt"
And use this code
: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];}
2. Called "Clear_Userman_Sessions_Send_to_Session_txt"
:local Flag
:set Flag [/tool user-manager session find]
:if ([:len $Flag] > 0) do={/tool user-manager session print append file session;/tool user-manager session remove [/tool user-manager session find];}
Then schedule each script to however much you want.
Remember that you should download and then delete the two files that it creates on your routers file system called log.txt and session.txt and retain those on your PC or wherever if you want a record.
If you don't want the scripts to first output a copy of what it deletes to log.txt and session.txt on your routers file system then in the code, for both scripts remove the wording " append file session" so that you have something that looks like this

Create 2 script's in Winbox

1. Called "Clear_Userman_Logs"
And use this code
:local Flag
:set Flag [/tool user-manager log find]
:if ([:len $Flag] > 0) do={/tool user-manager log print;/tool user-manager log remove [/tool user-manager log find];}
2. Called "Clear_Userman_Sessions"
: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];}
With a litte bit more scripting, you could make it, instead of store the file on your routers file system, email the file to you, then delete the stored file, so it does not take up space and you don't have to worry about downloading it. Eventually I will figure that out.
 
Red0ktober
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Fri Jun 26, 2009 8:42 pm

Re: Can't Remove Userman Logs

Thu Sep 23, 2010 6:42 pm

I've tried these scripts on v4.11, but they don't seem to do anything. Don't seem to hit the processor either.

My backup weighs in at 24.7Mb. Our UM server is x86, but just as an exercise I tried to restore the database to an RB450G (also running v4.11), but it times out. I think I need to thin down the file first. I have 284000 under sessions and 156000 under logs.
 
Staaldraad
just joined
Posts: 1
Joined: Sun May 08, 2011 11:12 pm

Re: Can't Remove Userman Logs

Sun May 08, 2011 11:38 pm

try this script to delete all UM logs :
:foreach i in=[/tool user-manager log find] do { /tool user-ma
nager log remove $i; }

Thank you very much, this worked well for me. ( RB411AH v4.16 )

What I did was run the script from winbox, cpu goes up to 100%, and leave it alone. I had 127000 log entries and it took about 30 min to complete.

Then run script /tool user-manager database rebuild and you will have a clean log and lots of disk space.

Hope this helps anyone

Who is online

Users browsing this forum: No registered users and 5 guests