GB | BIG5
|
| 首頁 > 系統管理 > 其它 > 正文 |
 |
| 檢查log紀錄 -----logcheck |
| 本文出自:OHaHa的學習心得[ohaha.ks.edu.tw] 作者:藍色泡泡(panda@ks.edu.tw) (2002-03-11 06:02:01) |
你覺得用vi 或是tail 查詢 log紀錄 很麻煩嗎?
你可以有新的選擇...
logcheck 官方網站:
http://www.psionic.com/index_html
1.檔案下載
http://www.psionic.com/tools/logcheck-1.1.1.tar.gz
ftp://ohaha.ks.edu.tw/pub/source/logcheck-1.1.1.tar.gz
2.安裝
a. 將檔案移放到 /usr/local (養成好習慣喔..自己額外安裝的放在/usr/local)
b. 將檔案解開..
root@ohaha[/usr/local]#tar zxvf logcheck-1.1.1.tar.gz
c. 安裝
c.1 切換到該目錄
root@ohaha[/usr/local]#cd logcheck-1.1.1
c.2 編譯安裝
首先先打 make 會出現以下的訊息
root@ohaha[/usr/local/logcheck-1.1.1]#make
Usage: make
is one of:
linux, bsdos, freebsd, sun, generic, hpux, digital
NOTE: This will make and install the package in these
directories:
logcheck configuration files : /usr/local/etc
logcheck.sh shell script : /usr/local/etc
logtail program : /usr/local/bin
Edit the makefile if you wish to change these paths.
Any existing files will be overwritten.
很明顯的...我們皆下來要做啥呢?很聰明 答案是make freebsd
c.3 編譯安裝
root@ohaha[/usr/local/logcheck-1.1.1]#make freebsd
c.4 完成安裝
d. 後設定..
我們安裝完後會出現一行訊息 不知您注意到了沒?
Done. Don't forget to set your crontab.
所以拉~~
我們要開始設定crontab了...
d.1 設定crontab
root@ohaha[/usr/local/logcheck-1.1.1]#crontab -e
新增下面這一行...
0 * * * * /usr/local/etc/logcheck.sh
(時間自己訂...)
d.2 收信..
打開您的收信程式...收信吧...會寄往root ...
d.3 結果...
他會幫您分類喔~~
Security Violations
=-=-=-=-=-=-=-=-=-=
Apr 9 14:38:57 ohaha su: xxxx to root on /dev/ttyp0
Unusual System Events
=-=-=-=-=-=-=-=-=-=-=
Apr 9 14:00:02 ohaha /kernel: Connection attempt to TCP 163.16.1.99:113 from 163.16.1.1:2731
Apr 9 14:14:53 ohaha /kernel: Connection attempt to TCP 163.16.1.99:113 from 163.16.1.1:2750
Apr 9 14:38:57 ohaha su: xxxx to root on /dev/ttyp0
d.4 這樣是不是簡單了些勒?
(http://www.fanqiang.com)
進入【UNIX論壇】
|
|
| 相關文章 |
|
|
|
|
 |
★ 樊強制作 歡迎分享 ★ |