logwatch - 윈디하나의 솔라나라

목차

개요

설치

배포 패키지를 받아 설치파일을 실행하면 아래와 같이 자동으로 실행된다. 솔라리스 11에서는 /usr/gnu/bin에 있는 유틸을 사용해야 오류가 나지 않기 때문에 PATH를 변경해 실행한다.

windy@wl ~/src # wget "https://downloads.sourceforge.net/project/logwatch/logwatch-7.4.3/logwatch-7.4.3.tar.gz"
windy@wl ~/src # tar xvfz logwatch-7.4.3.tar.gz
windy@wl ~/src # cd logwatch-7.4.3
windy@wl ~/src/logwatch-7.4.3 # export PATH=/usr/gnu/bin:$PATH
windy@wl ~/src/logwatch-7.4.3 # bash install_logwatch.sh
#################################
Preparing to install Logwatch
Enter the path to the Logwatch BaseDir [/usr/share/logwatch] :
### Using /usr/share/logwatch
Enter the path for the Logwatch ConfigDir [/etc/logwatch] :
### Using /etc/logwatch
Enter the dir name to be used for temp files [/var/cache/logwatch] :
### Using /var/cache/logwatch
Enter the location of perl [/usr/bin/perl] :
### Using /usr/bin/perl
Enter the dir name to used for the manpage [/usr/share/man] :
### Using /usr/share/man
### Installing
Created symlink for /usr/sbin/logwatch
################ README ####################.
You need to setup your cron job for logwatch.
A sample script is included see /etc/logwatch/logwatch.cron.
2 0 * * * /etc/logwatch/logwatch.cron >/dev/null 2>&1
root@wl ~/logwatch-7.4.3 # vi /usr/share/logwatch/default.conf/logwatch.conf1)
root@wl ~/logwatch-7.4.3 # crontab -e 2)
2 0 * * * /etc/logwatch/logwatch.cron >/dev/null 2>&1
1) 필요한 설정은 여기서 바꾼다. 바꾸지 않으면 리포트를 root 메일로 보낸다.
2) crontab 에 등록한다

실행

logwatch 는 수동으로 실행할 필요 없는 프로그램이지만, 확인 차원에서 아래와 같이 실행해볼 수 있다.
root@wl ~ # /usr/sbin/logwatch
 ################### Logwatch 7.4.3 (04/27/16) ####################
        Processing Initiated: Tue Dec 11 10:02:56 2018
        Date Range Processed: yesterday
                              ( 2018-Dec-10 )
                              Period is day.
        Detail Level of Output: 0
        Type of Output/Format: stdout / text
        Logfiles for Host: wl
 ##################################################################

 --------------------- ftpd-xferlog Begin ------------------------

 TOTAL KB OUT: 158KB (0MB)
 TOTAL KB IN: 3188KB (3MB)

 ---------------------- ftpd-xferlog End -------------------------


 --------------------- Named Begin ------------------------

 ---------------------- Named End -------------------------


 --------------------- proftpd-messages Begin ------------------------

...
 0.0.0.0 - ProFTPD 1.3.6 (stable) (built 월 12월 10 2018 15:10:19 KST) standalone mode STARTUP

 ---------------------- proftpd-messages End -------------------------


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

 Filesystem             Size   Used  Available Capacity  Mounted on
 rpool/ROOT/solaris     146G    28G        31G    48%    /
...

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


 --------------------- lm_sensors output Begin ------------------------

 grep: /proc/cpuinfo: No such file or directory

 ---------------------- lm_sensors output End -------------------------


 --------------------- ZFS Report Begin ------------------------

 Total ZFS pools:   1
 Total filesystems: 20 (20 mounted)
 Total snapshots:   10
 Total volumes:     2

 ------------------- ZFS Pool Summary -------------------

   Pool Name        Size (MiB)  Used (MiB)  Free (MiB)  Dedup
   rpool              151552.0    116736.0     34713.6  1.00x       77%

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


 ---------------------- ZFS Report End -------------------------


 ###################### Logwatch End #########################
RSS ATOM XHTML 5 CSS3