변군이글루

[리눅스] logwatch 시스템 로그 메일로 받기 본문

서___리눅스

[리눅스] logwatch 시스템 로그 메일로 받기

변군 변군이글루 2013.07.12 14:03

logwatch 시스템 로그 메일로 받기

 

1. logwatch 설치 확인
[root@byungun ~]# rpm -qa | grep logwatch
logwatch-7.3-8.el5

 

2. logwatch 설치
[root@byungun ~]# yum install logwatch

 

3. logwatch 설정 파일
/usr/share/logwatch/default.conf/logwatch.conf :
설정 파일
/etc/cron.daily/0logwatch :
크론(하루에 한 번 구동)

 

4. 메일주소 변경(받는 메일)
[root@byungun ~]# vi /usr/share/logwatch/default.conf/logwatch.conf
---------------------------------------------------------------------
# Default Log Directory
# All log-files are assumed to be given relative to this directory.
LogDir = /var/log

 

# You can override the default temp directory (/tmp) here
TmpDir = /var/cache/logwatch

 

# Default person to mail reports to. Can be a local account or a
# complete email address.
#MailTo = root
MailTo =
webmaster@sangchul.kr
# Default person to mail reports from. Can be a local account or a
# complete email address.
MailFrom = Logwatch
---------------------------------------------------------------------

 

5. 보내는 메일 도메인 변경
[root@byungun ~]# vi /etc/hosts
---------------------------------------------------------------------
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               byungun byungun.secdns.co.kr localhost
#127.0.0.1              byungun localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
---------------------------------------------------------------------

 

6. 메일 보내기(메일 테스트)
[root@byungun cron.daily]# cd /etc/cron.daily
[root@byungun cron.daily]# ./0logwatch

 

 

 

2 Comments
  • 프로필사진 변군 변군이글루 2013.07.12 14:03 신고 25 TCP Port 열려있는지 확인 해보세요~

    [root@byungun ~]# netstat -nlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2245/sendmail: acce
  • 프로필사진 변군 변군이글루 2013.07.12 14:03 신고 # cat /etc/hosts.deny
    #
    # hosts.deny This file describes the names of the hosts which are
    # *not* allowed to use the local INET services, as decided
    # by the '/usr/sbin/tcpd' server.
    #
    # The portmap line is redundant, but it is left to remind you that
    # the new secure portmap uses hosts.deny and hosts.allow. In particular
    # you should know that NFS uses portmap!
    All : All

    # cat /etc/hosts.allow
    #
    # hosts.allow This file describes the names of the hosts which are
    # allowed to use the local INET services, as decided
    # by the '/usr/sbin/tcpd' server.
    #
    sendmail : ALL
댓글쓰기 폼