Setup logwatch on Ubuntu: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Fix: remove --- horizontal lines (7 removed))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}


{{TOC}}
== Overview ==
Setup logwatch on Ubuntu에 대한 기술 문서입니다.
=== Summary ===
* 무엇인가? - Setup logwatch on Ubuntu
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
== Purpose ==
이 문서가 존재하는 이유
* Goal: Setup logwatch on Ubuntu에 대한 기술 정보 제공
* Scope: Setup logwatch on Ubuntu의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
== Key Concepts ==
{| class="wikitable"
! Concept
! Description
! Related
|-
| Setup logwatch on Ubuntu
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}
== Detailed Explanation ==


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.
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
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<ref>https://ubuntu.com/server/docs/logwatch</ref> ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# On Ubuntu
# On Ubuntu
sudo apt install logwatch
sudo apt install logwatch
# Crate temporary directory
# Crate temporary directory
sudo mkdir /var/cache/logwatch
sudo mkdir /var/cache/logwatch
#Logwatch’s default configuration is in /usr/share/logwatch/default.conf/logwatch.conf.  
#Logwatch’s default configuration is in /usr/share/logwatch/default.conf/logwatch.conf.  
#However, configuration changes made directly to that file can be overwritten during updates
#However, configuration changes made directly to that file can be overwritten during updates
#so instead the file should be copied into /etc and modified the copied files for configuration
#so instead the file should be copied into /etc and modified the copied files for configuration
sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/
sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/
# The two configuration files are   
# The two configuration files are   
default.conf/services
default.conf/services
dist.conf/services
dist.conf/services
#By default, Logwatch will monitor logs for all services on the system
#By default, Logwatch will monitor logs for all services on the system
#undesired service can be disabled through the Service parameter, for example,
#undesired service can be disabled through the Service parameter, for example,
Service = "-http"
Service = "-http"
Service = "-eximstats"
Service = "-eximstats"
</syntaxhighlight>
</syntaxhighlight>
== Test logwatch ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$ sudo logwatch --detail Low --range today
</syntaxhighlight>


== Customize logwatch service ==
The default logwatch.conf  can control logwatch output sections. admin can enable or disable services by editing service sections logwatch.conf file<syntaxhighlight lang="bash">
# -service name will disable the service
...
# You can also disable certain services (when specifying all)
Service = "-sudo"     
Service = "-secure"     
Service = "-pam_unix"     
Service = "-dpkg"     
Service = "-spamassassin"     
Service = "-zz-lm_sensors"
...
</syntaxhighlight>


== Enable [[Smartctl#smartd using systemd|smartd]] to logwatch on Ubuntu<ref>https://ubuntuforums.org/showthread.php?t=2268073</ref> ==
== Best Practices ==
<syntaxhighlight lang="bash">
# To enable smart information to logwatch on Ubuntu
# Edit edited the smart.conf files in both files /usr/share/logwatch/default.conf/services and /usr/share/logwatch/dist.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 -------------------------
...


</syntaxhighlight>


== References ==
== References ==
<references />
 
* [https://wiki.hpcmate.com Setup logwatch on Ubuntu]
 
 
== Related Pages ==
 
* [[Linux]]
* [[Server]]
* [[Hardware]]
* [[Network]]
 
 
[[Category:Linux]]
== Knowledge Graph ==
 
Related
 
→ [[Linux]]
→ [[Server]]
→ [[Hardware]]
→ [[Network]]
 
[[Category:Configuration]]

Latest revision as of 11:30, 17 July 2026

Template:Status

Template:TOC

Overview

Setup logwatch on Ubuntu에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Setup logwatch on Ubuntu
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


Purpose

이 문서가 존재하는 이유

  • Goal: Setup logwatch on Ubuntu에 대한 기술 정보 제공
  • Scope: Setup logwatch on Ubuntu의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장


Key Concepts

Concept Description Related
Setup logwatch on Ubuntu HPC/서버 환경에서 중요한 기술 개념 Linux, Server


Detailed Explanation

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

# On Ubuntu
sudo apt install logwatch
# Crate temporary directory
sudo mkdir /var/cache/logwatch
#Logwatch’s default configuration is in /usr/share/logwatch/default.conf/logwatch.conf. 
#However, configuration changes made directly to that file can be overwritten during updates
#so instead the file should be copied into /etc and modified the copied files for configuration
sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/
# The two configuration files are  
default.conf/services
dist.conf/services
#By default, Logwatch will monitor logs for all services on the system
#undesired service can be disabled through the Service parameter, for example,
Service = "-http"
Service = "-eximstats"

<syntaxhighlight lang="bash">


Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증


References


Related Pages

Knowledge Graph

Related

LinuxServerHardwareNetwork