Database Reference
In-Depth Information
Log rotation can also be controlled by including attributes for the files that need to be included in log rotation in
the /etc/logrotate.d directory. These can include various directives, depending on the type of log file that is being
rotated. Listing 7-27 provides an example of an HTTP service log-file rotation with post-rotate directives as well.
Listing 7-27. Logrotate.d. Httpd
[root@farshad-linux logrotate.d]# vi httpd
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
Logwatch is another facility that gives a daily synopsis of what the system looks like. Listing 7-28 provides an
example of what a logwatch output looks like.
Listing 7-28. Logwatch
:
################### Logwatch 7.3 (03/24/06) ####################
Processing Initiated: Sat Jun 29 04:02:01 2013
Date Range Processed: yesterday
( 2013-Jun-28 )
Period is day.
Detail Level of Output: 0
Type of Output: unformatted
Logfiles for Host: odax32
##################################################################
--------------------- SSHD Begin ------------------------
Users logging in through sshd:
root:
10.10.7.51: 1 time
---------------------- SSHD End -------------------------
--------------------- Disk Space Begin ------------------------
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroupSys-LogVolRoot
30G 19G 9.2G 67% /
/dev/md0 99M 48M 47M 51% /boot
/dev/mapper/VolGroupSys-LogVolU01
97G 32G 61G 34% /u01
/dev/mapper/VolGroupSys-LogVolOpt
59G 24G 32G 43% /opt
---------------------- Disk Space End -------------------------
###################### Logwatch End #########################
 
Search WWH ::




Custom Search