logwatch - 윈디하나의 솔라나라
|
/var/log의 로그 파일들을 분석해 그 내용을 메일로 보내준다. 매일 로그 살피는 일을 조금이나마 줄여주는, 이렇게 좋은 프로그램이 솔라리스에 잘 안 알려져있지 않은 것은 아마도 이 프로그램이 리눅스용(정확하게는 레드햇)으로 만들어져있기 때문이다. 하지만 현재의 버전은 솔라리스에서 사용할 수 있다.배포 패키지를 받아 설치파일을 실행하면 아래와 같이 자동으로 실행된다. 솔라리스 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>&11) 필요한 설정은 여기서 바꾼다. 바꾸지 않으면 리포트를 root 메일로 보낸다.
logwatch.pl은 펄 프로그램이기 때문에 특별한 컴파일 과정이 필요 없다./etc/log.d/conf/logwatch.conf에 있는 내용이며 수정할 사항이 있다면 수정한다. 필자는 logwatch.conf의 내용 중 MailTo = root 부분만 변경해 사용한다.
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 |
Copyright © 2004-2025 Jo HoSeok. All rights reserved. |