Setup logwatch on Ubuntu
Jump to navigation
Jump to search
A log file is a collection of events and activities that have occurred over a specified period of time. The containing too much detailed and repeated information make system administrator very difficult to go through all logs.
Logwatch is a customizable tool that analyzes system log files based on areas you specify. It then generates the report of what is happening on the server and email it to the specified address if you want
Setup logwatch
# On Ubuntu
$ sudo apt install logwatch
# two configuration files are at /usr/share/logwatch
default.conf/services
distt.conf/services
Test logwatch
$ sudo logwatch --detail Low --range today
Enable smartd to logwatch on Ubuntu[1]
# To enable smart information to logwatch on Ubuntu
# Edit LogFile contents in both files /usr/share/logwatch/default.conf/services and /usr/share/logwatch/distt.conf/services
"LogFile =" to LogFile = syslog
# Above logwatch command will show smartd logs, for example
...
--------------------- Smartd Begin ------------------------
/dev/sda [SAT] :
Usage: Temperature_Celsius (194) changed to
119, 116, 117, 116,
/dev/sdb [SAT] :
Usage: Temperature_Celsius (194) changed to
118, 116,
/dev/sdc [SAT] :
Usage: Temperature_Celsius (194) changed to
166, 162,
Offline uncorrectable sectors detected:
/dev/sdc [SAT] - 15 Time(s)
3 offline uncorrectable sectors detected
---------------------- Smartd End -------------------------
...