logwatch

os/UNIX_LINUX 2017. 6. 5. 11:31
반응형

 

[root@MYSERVER01|/root]# yum install logwatch

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                              | 4.9 kB     00:00
 * base: mirror.oasis.onnetcorp.com
 * epel: ftp.riken.jp
 * extras: mirror.oasis.onnetcorp.com
 * updates: mirror.oasis.onnetcorp.com
base                                                                                                                       | 3.7 kB     00:00
cr                                                                                                                         | 2.9 kB     00:00
epel                                                                                                                       | 4.3 kB     00:00
epel/primary_db                                                                                                            | 5.9 MB     00:00
extras                                                                                                                     | 3.4 kB     00:00
http://repo.nagios.com/nagios/6/repodata/repomd.xml: [Errno 12] Timeout on http://repo.nagios.com/nagios/6/repodata/repomd.xml: (28, 'Connection time-out')
Trying other mirror.
nagiosxi-deps                                                                                                              | 1.5 kB     00:00
updates                                                                                                                    | 3.4 kB     00:00
updates/primary_db                                                                                                         | 1.4 MB     00:00
Resolving Dependencies
--> Running transaction check
---> Package logwatch.noarch 0:7.3.6-55.el6 will be installed
--> Processing Dependency: perl(Date::Manip) for package: logwatch-7.3.6-55.el6.noarch
--> Running transaction check
---> Package perl-Date-Manip.noarch 0:6.24-1.el6 will be installed
--> Processing Dependency: perl(YAML::Syck) for package: perl-Date-Manip-6.24-1.el6.noarch
--> Running transaction check
---> Package perl-YAML-Syck.x86_64 0:1.07-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================
 Package                                 Arch                           Version                                Repository                    Size
==================================================================================================================================================
Installing:
 logwatch                                noarch                         7.3.6-55.el6                           base                         303 k
Installing for dependencies:
 perl-Date-Manip                         noarch                         6.24-1.el6                             base                         1.4 M
 perl-YAML-Syck                          x86_64                         1.07-4.el6                             base                          75 k

Transaction Summary
==================================================================================================================================================
Install       3 Package(s)

Total download size: 1.7 M
Installed size: 11 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): logwatch-7.3.6-55.el6.noarch.rpm                                                                                    | 303 kB     00:00
(2/3): perl-Date-Manip-6.24-1.el6.noarch.rpm                                                                               | 1.4 MB     00:00
(3/3): perl-YAML-Syck-1.07-4.el6.x86_64.rpm                                                                                |  75 kB     00:00
--------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                             8.9 MB/s | 1.7 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : perl-YAML-Syck-1.07-4.el6.x86_64                                                                                               1/3
  Installing : perl-Date-Manip-6.24-1.el6.noarch                                                                                              2/3
  Installing : logwatch-7.3.6-55.el6.noarch                                                                                                   3/3
  Verifying  : logwatch-7.3.6-55.el6.noarch                                                                                                   1/3
  Verifying  : perl-YAML-Syck-1.07-4.el6.x86_64                                                                                               2/3
  Verifying  : perl-Date-Manip-6.24-1.el6.noarch                                                                                              3/3

Installed:
  logwatch.noarch 0:7.3.6-55.el6

Dependency Installed:
  perl-Date-Manip.noarch 0:6.24-1.el6                                      perl-YAML-Syck.x86_64 0:1.07-4.el6

Complete!


[root@MYSERVER|/]# vi /usr/share/logwatch/default.conf/logwatch.conf


메일 수신자 계정 수정 변경 ..

MailTo = root


기본적으로 root로 설정이 되어 있는데

root 계정의 홈 디렉토리에

.forward 파일을 생성하고 해당 파일에 계정을 추가하여 root 계정의 메일을 사용자 계정의 메일로 포워딩 처리 가능.


[root@MYSERVER|/]# logwatch


결과 받아서 메일 수신 확인

 



<수신된 메일 내용>

-----------------------------------------------------------------------------------

Logwatch for MYSERVER (Linux)

logwatch@MYSERVER.localdomain( logwatch@MYSERVER.localdomain )

To:root@MYSERVER.localdomain<root@MYSERVER.localdomain>;


 ################### Logwatch 7.3.6 (05/19/07) #################### 

        Processing Initiated: Mon Jun  5 11:17:03 2017

        Date Range Processed: yesterday

                              ( 2017-Jun-04 )

                              Period is day.

      Detail Level of Output: 0

              Type of Output: unformatted

           Logfiles for Host: MYSERVER

  ################################################################## 

 

 --------------------- Disk Space Begin ------------------------ 


 Filesystem            Size  Used Avail Use% Mounted on

 /dev/mapper/vg_MYSERVER-lv_root     50G  5.2G   42G  12% /

 /dev/sda2                          477M  113M  339M  26% /boot

 /dev/sda1                          200M  264K  200M   1% /boot/efi

 

 --- 생략 ----

 

 

 ---------------------- Disk Space End ------------------------- 


 

 ###################### Logwatch End ######################### 





 

 

 

반응형
Posted by 공간사랑
,