SMA - インストール
SMA(sendmail log analyzer)のインストールについて解説します。
解析対象は/var/log/maillogとし、結果はHTMLで出力する事を前提としています。
用意するもの
sma-1.4.tar.gz
公式サイト
ダウンロードサイト
コンパイル&インストール
% tar zxvf sma-1.4.tar.gz
% cd sma-1.4
% vi conf.h
--- conf.h.orig 2006-05-04 02:00:30.440050000 +0900
+++ conf.h 2006-05-04 02:00:50.449795000 +0900
@@ -10,7 +10,7 @@
/*
* This is a default configuration file.
*/
-#define DEFAULT_CONF "./sma.conf"
+#define DEFAULT_CONF "/usr/local/etc/sma.conf"
/*
* Default hostname.
% make
% su
# make install
# cp sma.conf /usr/local/etc
コンフィグレーション
# vi /usr/local/etc/sma.conf
--- sma.conf.orig 2003-05-03 22:40:48.803769000 +0900
+++ sma.conf 2003-05-03 22:41:29.708880000 +0900
@@ -24,13 +24,13 @@
# You need this if SMA cannot find your hostname from the log files
# (Sendmail for NT) or if you want to override it.
-#HostName myhost.com
+HostName example.com
# Print output as file (same as command line option -o)
# If not given, write to stdout
-#OutFile /home/jt/report.html
+OutFile /usr/local/apache/htdocs/report.html
#
実行
crontabへ登録
0 0 * * * /usr/local/bin/sma