Community discussions

MikroTik App
 
daveleger
just joined
Topic Author
Posts: 6
Joined: Wed Apr 09, 2008 1:07 am

RB450 Disk Full - User-Manager Logs and Session

Sat Aug 02, 2008 5:40 pm

Hello,

I have run into a problem where the logs and sessions have filled up the disk on my RB450. This is a very small hotspot using UM and after 2 months, the logs and sessions have filled the disk.

I have been able to free up some space and disabled the hotspot so that users can at least access the Internet, but I am having real issues trying to remove the logs. I have 200k lines. Going 1000 at a time is slow and after doing several thousand, it does not appear to free up any disk space.

I have 3% free space (64MB disk space on a RB450) at the moment.

I tried a few script to remove the logs, but I believe that I need to have a significant amount of disk space available to use these script to remove the logs.

On a test RB, I un-installed user-manager and re-installed, thinking that would clear the db, but it did not. All the logs, users, credits, etc were still there.

I executed the command:
/tool user-manager database clear
and that cleared the database, erased everything. I am happy with that as I can restore using backups.

Now, I have yet to execute this on the RB with only 3% disk space left as I am worried it might need some disk space to execute it's command. I don't want to break this as it is in production and I am several km away in case that I have to go over and reflash the RB.

Can anybody confirm that running the above mentioned command would work even if the disk is full or close to being full (1.5MB of fee disk space) or if the database is corrupted?

I am hoping that they will add features to prune sessions and logs automatically in the future so that this does not happen again. I have disabled logging on all my other user-manager installations until a solution has been found.

Thanks so much,

Dave Leger
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: RB450 Disk Full - User-Manager Logs and Session

Mon Aug 18, 2008 10:19 am

Dave, it looks like other function is consuming all free space.
Do you have Dude package installed on that board ?
Try to disable it and see how it will help you.
 
ekkas
Long time Member
Long time Member
Posts: 567
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: RB450 Disk Full - User-Manager Logs and Session

Mon Jun 14, 2010 5:06 pm

I just uploaded a program where you can 'prune' as you call it users/sessions (and have version2 where logs can be deleted as well, ask me if you want it).
But it does not help. The users/session are deleted, but free space does not change.
Waiting for MT to tell me how I can compact the database. I cannot afford to clear the entire database as we have vouchers sold and do not know which is active or not. I can delete obviously old users/sessions wit my little program, but again, disk space remain unchanged... :-(
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: RB450 Disk Full - User-Manager Logs and Session

Tue Jun 15, 2010 2:43 pm

/tool user-manager database rebuild the only way to rebuild the database.
 
beny30
Member Candidate
Member Candidate
Posts: 137
Joined: Tue Aug 26, 2008 2:13 pm

Re: RB450 Disk Full - User-Manager Logs and Session

Sun Jun 20, 2010 11:08 am

Does this command compacts database? Will this decrease database size in order to free some disk space isues on RouterBoards?
If not is there any way to free space without losing Users registred in User Manager?
 
ekkas
Long time Member
Long time Member
Posts: 567
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: RB450 Disk Full - User-Manager Logs and Session

Sun Jun 20, 2010 12:57 pm

/tool user-manager database rebuild
will make it smaller, but first you have to delete unused users or sessions and logs. In my case the logs took up a lot of space.
/tool user-manager log remove
then type eg. numbers 1-10000
when finished, run it again and go numbers 10001-20000, etc. until all is deleted. (It takes a very long time)

Then run
/tool user-manager database rebuild
and you'll see lots of free space. :-)

Ekkas
(You can use the windows tool to find old users & delete them from there)
 
User avatar
dunga
Member Candidate
Member Candidate
Posts: 254
Joined: Fri Jan 23, 2009 9:51 am
Location: Nigeria

Re: RB450 Disk Full - User-Manager Logs and Session

Tue Jun 22, 2010 3:22 pm

i have similar problem, how to clear logs and sessions in user manager all at once.

i tried the step suggested by issuing this command
/tool user-manager log remove
but when i type the id number for the log, it shows invalid item number.

what number should be typed there.
 
lorell
newbie
Posts: 30
Joined: Fri Oct 02, 2009 3:15 am

Re: RB450 Disk Full - User-Manager Logs and Session

Wed Dec 29, 2010 5:26 pm

I am having the same problem on an RB1000.

When I try to delete the entries, it tells me:


/tool user-manager log> remove 0
failed to remove log: database or disk is full
 
lorell
newbie
Posts: 30
Joined: Fri Oct 02, 2009 3:15 am

Re: RB450 Disk Full - User-Manager Logs and Session

Wed Dec 29, 2010 10:15 pm

OK. Here is a work around on this problem. I had to remove my userman configuration and re-add it. I have lost all of my log files. And have to re-configure userman to not create log entries for each "router" (aka radius client).

1. /tool user-manager export
2. Copy and paste the whole config out to notepad or favorite text editing
3. /tool user-manager database clear
4. /tool user-manager database rebuild (frees up the HD space)
5. Optional. Change each "router" in notepad to have log="" instead of log=auth-ok,auth-fail,acct-fail.
6. Copy and paste the revised config back into the terminal window.

Voila! HD space is freed up, and logging is disabled.

The longer term-plan is to get a bigger HD, firewall my network from brute-force ssh and telnet login attempts (and thus eliminate so much logging) and then turn logging back on.

My guess as to the problem.

1. I had 127 devices all logging to the userman, creating 90,000 log entries in a 72 hour period.
2. The HD filled up, eventually causing database corruption.
3. Removing the 90,000 log entries did not work because of database corruption.
4. I could not remove or change each router's logging configuration through conventional means ("/tool user-manager router edit OR /tool user-manager router remove" did not work)
5. Clearing and rebuilding the database and re-loading the userman config was the only option available to me.

Router OS 4.16 on an RB1000 with 64MB HD space.

Thank goodness that I still had full access via winbox and that the userman kept on authenticating properly.
 
nspotorno
newbie
Posts: 29
Joined: Mon Jul 23, 2007 7:50 pm

Re: RB450 Disk Full - User-Manager Logs and Session

Tue Feb 21, 2012 6:03 pm

Here's a way to clear out the logs releasing a lot of free space

tool user-manager database clear-log

that will only clear out the logs without deleting any other sensitive information.

HTH
 
Mashimoto
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Thu Feb 24, 2011 3:55 pm

Re: RB450 Disk Full - User-Manager Logs and Session

Thu Apr 12, 2012 2:49 pm

worked for me perfectly on RB1100 ROSv5.4

thank you nspotorno!!
 
sneakie
just joined
Posts: 8
Joined: Tue Mar 30, 2010 12:29 pm
Location: South Africa

Re: RB450 Disk Full - User-Manager Logs and Session

Wed Sep 19, 2012 2:28 pm

Thank you. that worked for me as well.
 
stenlycicero
just joined
Posts: 3
Joined: Tue Dec 18, 2012 1:46 pm

Re: RB450 Disk Full - User-Manager Logs and Session

Sun Feb 17, 2013 2:39 am

thank you nspotorno.
you saved my life. I'm using RB1100AH, ROS 5.21
 
simeonboxco
just joined
Posts: 1
Joined: Mon Apr 29, 2013 12:59 pm

Re: RB450 Disk Full - User-Manager Logs and Session

Mon Apr 29, 2013 1:03 pm

Having that same proble on RB1200. I used this command to clear the user manager log and got 36% of my space back.

/tool user-manger database clear-log

Then rebuild the db with

/tool user-manager database rebuild
 
baumie
newbie
Posts: 42
Joined: Mon Mar 19, 2007 7:51 pm
Location: South Africa

Re: RB450 Disk Full - User-Manager Logs and Session

Wed Jan 06, 2016 6:37 pm

or you could try running a script
/tool user-manager session
:foreach i in=[/tool user-manager session find nas-port-type=ethernet] do= {/tool user-manager session remove $i}

It worked for me
 
faghihsmh
just joined
Posts: 4
Joined: Fri Feb 15, 2013 7:56 pm

Re: RB450 Disk Full - User-Manager Logs and Session

Sat Dec 14, 2019 8:03 am

hi
you can use a script and place it in system script
define a schedule to run it every one week for example
you can first backup and then delete the logs or only delete it

: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];}

Who is online

Users browsing this forum: No registered users and 6 guests