System Log

H3r0k0

Verified User
Joined
Jun 11, 2013
Messages
19
Hi,

Just wanted to know whats the best way to clean system logs without it causing any issues like errors ?

I heard of you can rotate your logs how do i go about this thanks.
 
Hello,

Nowadays almost all servers have logrotate enabled by default. Directadmin as well has logrotate mechanism.

You should clarify your requests if you face any issue so we could help you. Please consider if you're not a Directadmin user then you'd better try your luck with other public communities.

p.s. And of course man pages is a good source of knowledges.
 
Ohh i was not sure but yes your right it dose. No I am a DirectAdmin user.

But yeah I have an issue with my MySQL not connecting to database. It goes down sometimes not sure what to do to fix the issue.


Code:
This is an automated message notifying you that the 5 minute load average on your system is 233.97.
This has exceeded the 10 threshold.

One Minute      - 247.62
Five Minutes    - 233.97
Fifteen Minutes - 238.44

top - 08:37:18 up 1 day, 12:33,  0 users,  load average: 247.62, 233.97, 238.44
Tasks: 567 total,   2 running, 565 sleeping,   0 stopped,   0 zombie
Cpu(s): 35.2%us,  1.9%sy,  0.6%ni, 43.6%id, 18.5%wa,  0.1%hi,  0.2%si,  0.0%st
Mem:   3838640k total,  3749364k used,    89276k free,     3100k buffers
Swap:  8388604k total,  3695636k used,  4692968k free,    44972k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
1526 apache    20   0  232m  23m 3928 S  2.6  0.6   0:00.87 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5732 apache    20   0  205m 9436 3128 S  2.6  0.2   0:00.02 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5844 root      20   0 15428 1512  812 R  2.6  0.0   0:00.03 /usr/bin/top -c -b -n 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
5846 root      20   0 15428 1512  812 R  2.6  0.0   0:00.03 /usr/bin/top -c -b -n 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
21770 apache    20   0  235m  17m 4048 D  2.6  0.5   0:02.16 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
  22 root      20   0     0    0    0 S  1.3  0.0   0:56.65 [kblockd/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
   1 root      20   0 19364  980  812 S  0.0  0.0   0:01.36 /sbin/init                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
   2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [kthreadd]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
   3 root      RT   0     0    0    0 S  0.0  0.0   0:00.09 [migration/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   4 root      20   0     0    0    0 S  0.0  0.0   0:00.17 [ksoftirqd/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [stopper/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
   6 root      RT   0     0    0    0 S  0.0  0.0   0:01.52 [watchdog/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
   7 root      RT   0     0    0    0 S  0.0  0.0   0:00.08 [migration/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [stopper/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
   9 root      20   0     0    0    0 S  0.0  0.0   0:00.18 [ksoftirqd/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  10 root      RT   0     0    0    0 S  0.0  0.0   0:00.08 [watchdog/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  11 root      20   0     0    0    0 S  0.0  0.0   0:05.14 [events/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
  12 root      20   0     0    0    0 S  0.0  0.0   0:04.77 [events/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
  13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [cgroup]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [khelper]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
  15 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [netns]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  16 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [async/mgr]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
  17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [pm]
 
Last edited:
You should hire somebody to fix it for you, or search the forums if you want to fix it yourself. You can use "high load" as search keys.
Thanks ill look into it more. Also could the issue be ram (4gb).
 
I see swap is actively used, that is not good. I have no information about your server, so I don't say anything about whether or not 4Gb is enough for your server. If you want me to check and optimize your server, please send me a PM for a quote. After I login to your server and do an audit I'll be able to say is it OK for your server have only 4Gb RAM or not.
 
I see swap is actively used, that is not good. I have no information about your server, so I don't say anything about whether or not 4Gb is enough for your server. If you want me to check and optimize your server, please send me a PM for a quote. After I login to your server and do an audit I'll be able to say is it OK for your server have only 4Gb RAM or not.

Hi,

Could it be that the swap file is increased if so how do I go about check this. Thanks in advance.
 
If server uses swap actively, it might slow down, so you should reconfigure and optimize services. You should not increase swap.
 
I was looking at logrotate in debug mode to see if i can find any issues or something. But i really don't understand it much.

Code:
[root@server ~]# cat /var/lib/logrotate.status
logrotate state -- version 2
"/var/log/exim/rejectlog" 2015-1-4
"/var/log/secure" 2015-1-4
"/var/log/dracut.log" 2015-1-1
"/var/log/directadmin/errortaskq.log" 2015-1-4
"/var/named/data/named.run" 2015-1-4
"/var/log/directadmin/system.log" 2015-1-4
"/var/log/munin-node/munin-node.log" 2015-1-3
"/var/log/munin/munin-graph.log" 2015-1-4
"/var/log/httpd/referer_log" 2014-11-19
"/var/log/httpd/suexec_log" 2014-11-19
"/var/log/munin/munin-update.log" 2015-1-4
"/var/log/cron" 2015-1-4
"/var/log/httpd/access_log" 2015-1-4
"/var/log/spooler" 2015-1-4
"/var/log/yum.log" 2015-1-1
"/var/log/directadmin/login.log" 2015-1-4
"/var/log/httpd/agent_log" 2014-11-19
"/var/log/btmp" 2015-1-1
"/var/log/proftpd/access.log" 2015-1-4
"/var/log/proftpd/xferlog.legacy" 2015-1-4
"/var/log/directadmin/security.log" 2015-1-4
"/var/log/suphp.log" 2014-11-19
"/var/log/exim/mainlog" 2015-1-4
"/var/log/munin/munin-html.log" 2015-1-4
"/var/log/exim/processlog" 2015-1-4
"/var/lib/mysql/mysqld.log" 2014-11-19
"/var/log/wtmp" 2014-11-18
"/var/account/pacct" 2014-11-18
"/var/log/maillog" 2015-1-4
"/var/log/httpd/error_log" 2015-1-4
"/var/log/munin/munin-limits.log" 2015-1-4
"/var/log/messages" 2015-1-4
"/var/log/exim/paniclog" 2015-1-4
"/var/log/proftpd/auth.log" 2015-1-4
"/var/log/directadmin/error.log" 2015-1-4
[root@server ~]# /usr/sbin/logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
Ignoring .virtualhosts.swp, because of .swp ending
reading config file apache
reading config info for /var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log /var/log/httpd/suexec_log /var/log/suphp.log 
reading config file directadmin
reading config info for /var/log/directadmin/error.log /var/log/directadmin/errortaskq.log /var/log/directadmin/security.log /var/log/directadmin/system.log /var/log/directadmin/login.log 
reading config file dracut
reading config info for /var/log/dracut.log 
reading config file exim
reading config info for /var/log/exim/mainlog /var/log/exim/processlog /var/log/exim/rejectlog /var/log/exim/paniclog 
reading config file munin
reading config info for /var/log/munin/munin-update.log 
reading config info for /var/log/munin/munin-graph.log 
reading config info for /var/log/munin/munin-html.log 
reading config info for /var/log/munin/munin-limits.log 
reading config file munin-node
reading config info for /var/log/munin-node/munin-node.log 
reading config file mysql
reading config info for /var/lib/mysql/mysqld.log 
reading config file named
reading config info for /var/named/data/named.run 
reading config file proftpd
reading config info for /var/log/proftpd/access.log /var/log/proftpd/auth.log /var/log/proftpd/xferlog.legacy 
reading config file psacct
reading config info for /var/account/pacct 
reading config file syslog
reading config info for /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler

reading config file yum
reading config info for /var/log/yum.log 
reading config info for /var/log/wtmp 
reading config info for /var/log/btmp 

Handling 17 logs

rotating pattern: /var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log /var/log/httpd/suexec_log /var/log/suphp.log  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/httpd/access_log
  log does not need rotating
considering log /var/log/httpd/agent_log
  log /var/log/httpd/agent_log does not exist -- skipping
considering log /var/log/httpd/error_log
  log does not need rotating
considering log /var/log/httpd/referer_log
  log /var/log/httpd/referer_log does not exist -- skipping
considering log /var/log/httpd/suexec_log
  log /var/log/httpd/suexec_log does not exist -- skipping
considering log /var/log/suphp.log
  log /var/log/suphp.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/directadmin/error.log /var/log/directadmin/errortaskq.log /var/log/directadmin/security.log /var/log/directadmin/system.log /var/log/directadmin/login.log  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/directadmin/error.log
  log does not need rotating
considering log /var/log/directadmin/errortaskq.log
  log does not need rotating
considering log /var/log/directadmin/security.log
  log does not need rotating
considering log /var/log/directadmin/system.log
  log does not need rotating
considering log /var/log/directadmin/login.log
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/dracut.log  yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dracut.log
  log does not need rotating

rotating pattern: /var/log/exim/mainlog /var/log/exim/processlog /var/log/exim/rejectlog /var/log/exim/paniclog  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/exim/mainlog
  log does not need rotating
considering log /var/log/exim/processlog
  log does not need rotating
considering log /var/log/exim/rejectlog
  log does not need rotating
considering log /var/log/exim/paniclog
  log does not need rotating

rotating pattern: /var/log/munin/munin-update.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/munin/munin-update.log
  log does not need rotating

rotating pattern: /var/log/munin/munin-graph.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/munin/munin-graph.log
  log does not need rotating

rotating pattern: /var/log/munin/munin-html.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/munin/munin-html.log
  log does not need rotating

rotating pattern: /var/log/munin/munin-limits.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/munin/munin-limits.log
  log does not need rotating

rotating pattern: /var/log/munin-node/munin-node.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/munin-node/munin-node.log
  log does not need rotating

rotating pattern: /var/lib/mysql/mysqld.log  after 1 days (3 rotations)
empty log files are not rotated, old logs are removed
considering log /var/lib/mysql/mysqld.log
  log /var/lib/mysql/mysqld.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/named/data/named.run  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/named/data/named.run
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/proftpd/access.log /var/log/proftpd/auth.log /var/log/proftpd/xferlog.legacy  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/proftpd/access.log
  log does not need rotating
considering log /var/log/proftpd/auth.log
  log does not need rotating
considering log /var/log/proftpd/xferlog.legacy
  log does not need rotating
not running postrotate script, since no logs were rotated
not running postrotate script, since no logs were rotated
not running postrotate script, since no logs were rotated

rotating pattern: /var/account/pacct  after 1 days (31 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
 weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/cron
  log does not need rotating
considering log /var/log/maillog
  log does not need rotating
considering log /var/log/messages
  log does not need rotating
considering log /var/log/secure
  log does not need rotating
considering log /var/log/spooler
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/yum.log  yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/yum.log
  log does not need rotating

rotating pattern: /var/log/wtmp  monthly (1 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
  log does not need rotating

rotating pattern: /var/log/btmp  monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
  log does not need rotating

Am wishing this would shed some light on whats going on.
 
Back
Top