Life is fun and easy!
不正IP報告数
Okan Sensor
ページへ戻る
印刷
MacOS X/daily.out
をテンプレートにして作成 ::
UJP
tech_regist2
:MacOS X/daily.out をテンプレートにして作成
開始行:
TITLE:daily.out
*daily.out
**はじめに
MacOS Xには,/var/log/daily.outというファイルがあるが,...
sh-3.2# ls -lah /var/log/daily.out
-rw-r--r-- 1 root wheel 38G Feb 1 03:20 /var/log/d...
sh-3.2#
38GBの単一ファイルも凄いが,実は2007年から蓄積されたフ...
sh-3.2# pwd
/var/log
sh-3.2# ls -lah daily.out*
-rw-r--r-- 1 root wheel 28M Feb 15 03:17 daily.out
-rw-r--r-- 1 root wheel 26M Feb 14 03:15 daily.out....
-rw-r--r-- 1 root wheel 330M Feb 13 03:16 daily.out....
sh-3.2#
と言う事でこれをできるだけ少なくして行く.
**daily.outとは何なのか
daily.outとは,LinuxではなくBSD系のOSにあるもので,その...
/private/etc/periodic/daily/
早速そのディレクトリをみてみます.
sh-3.2# ls -la /private/etc/periodic/daily/
total 16
drwxr-xr-x 15 root wheel 510 Dec 1 2009 .
drwxr-xr-x 5 root wheel 170 May 19 2009 ..
-r-xr-xr-x 1 root wheel 1389 May 19 2009 100.clean-...
-r-xr-xr-x 1 root wheel 1592 May 19 2009 110.clean-...
-r-xr-xr-x 1 root wheel 695 May 19 2009 130.clean-...
-r-xr-xr-x 1 root wheel 1056 May 19 2009 140.clean-...
-r-xr-xr-x 1 root wheel 378 May 19 2009 199.clean-...
-r-xr-xr-x 1 root wheel 1211 May 19 2009 310.accoun...
-r-xr-xr-x 1 root wheel 522 May 19 2009 400.status...
-r-xr-xr-x 1 root wheel 548 May 19 2009 420.status...
-r-xr-xr-x 1 root wheel 687 May 19 2009 430.status...
-r-xr-xr-x 1 root wheel 4179 Jul 8 2007 500.daily~...
-rwxr-xr-x 1 root wheel 8439 May 19 2009 600.daily....
-rwxr-xr-x 1 root wheel 4539 May 19 2009 700.daily....
-r-xr-xr-x 1 root wheel 712 May 19 2009 999.local
sh-3.2#
ファイル名から,クリーニング系とステータス表示系があり...
**クリーニング系
***100.clean-logs
そのなの通り,ログをクリアします.古いログを見つけて,...
まずは,諸設定がこのファイルに保存されています.
/etc/defaults/periodic.conf
この設定ファイルの通りに動作するのですが,$daily_clean_...
にあるファイルで,$daily_clean_logs_days経過したファイル...
sh-3.2# grep daily_clean_logs_days /etc/defaults/periodi...
daily_clean_logs_days="60" # If not accessed for
sh-3.2# grep daily_clean_logs_dirs /etc/defaults/periodi...
daily_clean_logs_dirs="/Library/Logs/CrashReporter" # De...
sh-3.2#
つまり,これはCrash Reportで作成されたトレースファイル...
***110.clean-tmps
このシェルも100.clean-logsとほぼ同じ作りなのでパラメー...
daily_clean_tmps_days
daily_clean_tmps_dirs
sh-3.2# grep daily_clean_tmps_days /etc/defaults/periodi...
daily_clean_tmps_days="3" # If not accessed for
sh-3.2# grep daily_clean_tmps_dirs /etc/defaults/periodi...
daily_clean_tmps_dirs="/tmp" # Delete under here
sh-3.2#
3日以上経過した/tmp以下のファイルを消すと言う事になり...
***130.clean-msgs
daily_clean_msgs_days
/var/msgs
これも設定をみてみる.
sh-3.2# grep daily_clean_msgs_days /etc/defaults/periodi...
daily_clean_msgs_days= # If not modified for
sh-3.2#
何も定義されてない.msgsという仕組みがあり,OSへログイ...
***140.clean-rwho
daily_clean_rwho_days
/var/rwho
UNIXにはwhoというコマンドがあって,現在そのホストにログ...
***199.clean-fax
7日間
/var/spool/fax
これはFAXサーバを使っていればファイルが溜まっている事も...
***310.accounting
/var/account/acct
これはセキュリティ上のコマンド履歴を残すacctを導入して...
**ステータス表示系
***400.status-disks
daily_status_disks_df_flags
dfコマンド
dfコマンドをdaily_status_disks_df_flagsにあるパラメータ...
sh-3.2# grep daily_status_disks_df_flags /etc/defaults/p...
daily_status_disks_df_flags="-l -h" # df(1) flags for c...
sh-3.2#
実際に実行するとこんな感じです.
sh-3.2# df -l -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 149Gi 82Gi 66Gi 56% /
/dev/disk1s3 298Gi 248Gi 50Gi 84% /Volumes/Jun...
sh-3.2#
***420.status-network
netstatコマンドを実行しています.
netstat -i
netstat -in
***430.status-rwho
rwhoコマンドを実行しています.
***500.daily~previous
昔のdailyコマンドと言う事で,これまで紹介して来たログ削...
***600.daily.server
このシェルはPerlになります.その名の通りサーバ用のdaily...
/etc/diskspacemonitor/daily.server.conf
/var/log/diskspacemonitor.log
daily.server.confに設定が書かれています.ファイルを圧縮...
filename pattern : # versions : threshold in MB : thresh...
まずは,このファイル.これはcompressが指定してあります.
/Library/Logs/AppleFileService/AppleFileService*.log*[0-...
このファイルはファイル共有サービスのログ
/Library/Logs/WebServer/*error_log.[0-9]*[0-9] : 0 : 50...
/Library/Logs/WebServer/*access_log.[0-9]*[0-9] : 0 : 50...
これはWebサーバ.実際には,/var/log/apache2へのリンク.
/var/log/diskspacemonitor.log : 5 : 50 : 9999 : roll : :
/var/log/slapd.log : 5 : 50 : 9999 : roll : syslogd : HUP
/Library/Logs/slapconfig.log : 5 : 50 : 9999 : roll : :
これはLDAP関連.
/var/log/ppp/vpnd.log : 5 : 50 : 9999 : roll : vpnd :...
VPNサーバとして使っているとログされる様です.
/var/log/httpd/mod_jk.log : 5 : 50 : 9999 : roll : :
/var/log/apache2/mod_jk.log : 5 : 50 : 9999 : roll : :
WebサーバでJavaアプリを連携して動かしている時のログ.
/var/log/securityproxy/calDAV_access.log : 5 : 50...
/var/log/securityproxy/cardDAV_access.log : 5 : 50...
/var/log/securityproxy/web_access.log : 5 : 50...
/var/log/securityproxy/httpd_error.log : 5 : 50...
/var/log/securityproxy/secure_proxy_login.log : 5 : 50...
/var/log/securityproxy/mail_access.log : 5 : 50...
/var/log/securityproxy/mail_error.log : 5 : 50...
カレンダーサーバ,メールサーバでセキュリティプロキシを...
/var/log/swupd/swupd_access_log : 5 : 50 : 9999 ...
/var/log/swupd/swupd_error_log : 5 : 50 : 9999 ...
/var/log/swupd/swupd_syncd_log : 5 : 50 : 9999 ...
これはソフトウェアアップデート関連です.Windows でいう...
***700.daily.server.mail
このシェルもPerl.
/var/log/mailaccess.log
/var/log/mail.log
/var/log/amavis.log
/var/log/clamav.log
/var/log/freshclam.log
/var/log/mailman/*
mailaccess.logとmail.logはPostfix関連のログ.amavis.log...
mailmanはメーリングリストのソフト.
amavisd-new
http://www.amavis.org
***999.local
このシェルは,このディレクトリにあるシェルを実行する事...
終了行:
TITLE:daily.out
*daily.out
**はじめに
MacOS Xには,/var/log/daily.outというファイルがあるが,...
sh-3.2# ls -lah /var/log/daily.out
-rw-r--r-- 1 root wheel 38G Feb 1 03:20 /var/log/d...
sh-3.2#
38GBの単一ファイルも凄いが,実は2007年から蓄積されたフ...
sh-3.2# pwd
/var/log
sh-3.2# ls -lah daily.out*
-rw-r--r-- 1 root wheel 28M Feb 15 03:17 daily.out
-rw-r--r-- 1 root wheel 26M Feb 14 03:15 daily.out....
-rw-r--r-- 1 root wheel 330M Feb 13 03:16 daily.out....
sh-3.2#
と言う事でこれをできるだけ少なくして行く.
**daily.outとは何なのか
daily.outとは,LinuxではなくBSD系のOSにあるもので,その...
/private/etc/periodic/daily/
早速そのディレクトリをみてみます.
sh-3.2# ls -la /private/etc/periodic/daily/
total 16
drwxr-xr-x 15 root wheel 510 Dec 1 2009 .
drwxr-xr-x 5 root wheel 170 May 19 2009 ..
-r-xr-xr-x 1 root wheel 1389 May 19 2009 100.clean-...
-r-xr-xr-x 1 root wheel 1592 May 19 2009 110.clean-...
-r-xr-xr-x 1 root wheel 695 May 19 2009 130.clean-...
-r-xr-xr-x 1 root wheel 1056 May 19 2009 140.clean-...
-r-xr-xr-x 1 root wheel 378 May 19 2009 199.clean-...
-r-xr-xr-x 1 root wheel 1211 May 19 2009 310.accoun...
-r-xr-xr-x 1 root wheel 522 May 19 2009 400.status...
-r-xr-xr-x 1 root wheel 548 May 19 2009 420.status...
-r-xr-xr-x 1 root wheel 687 May 19 2009 430.status...
-r-xr-xr-x 1 root wheel 4179 Jul 8 2007 500.daily~...
-rwxr-xr-x 1 root wheel 8439 May 19 2009 600.daily....
-rwxr-xr-x 1 root wheel 4539 May 19 2009 700.daily....
-r-xr-xr-x 1 root wheel 712 May 19 2009 999.local
sh-3.2#
ファイル名から,クリーニング系とステータス表示系があり...
**クリーニング系
***100.clean-logs
そのなの通り,ログをクリアします.古いログを見つけて,...
まずは,諸設定がこのファイルに保存されています.
/etc/defaults/periodic.conf
この設定ファイルの通りに動作するのですが,$daily_clean_...
にあるファイルで,$daily_clean_logs_days経過したファイル...
sh-3.2# grep daily_clean_logs_days /etc/defaults/periodi...
daily_clean_logs_days="60" # If not accessed for
sh-3.2# grep daily_clean_logs_dirs /etc/defaults/periodi...
daily_clean_logs_dirs="/Library/Logs/CrashReporter" # De...
sh-3.2#
つまり,これはCrash Reportで作成されたトレースファイル...
***110.clean-tmps
このシェルも100.clean-logsとほぼ同じ作りなのでパラメー...
daily_clean_tmps_days
daily_clean_tmps_dirs
sh-3.2# grep daily_clean_tmps_days /etc/defaults/periodi...
daily_clean_tmps_days="3" # If not accessed for
sh-3.2# grep daily_clean_tmps_dirs /etc/defaults/periodi...
daily_clean_tmps_dirs="/tmp" # Delete under here
sh-3.2#
3日以上経過した/tmp以下のファイルを消すと言う事になり...
***130.clean-msgs
daily_clean_msgs_days
/var/msgs
これも設定をみてみる.
sh-3.2# grep daily_clean_msgs_days /etc/defaults/periodi...
daily_clean_msgs_days= # If not modified for
sh-3.2#
何も定義されてない.msgsという仕組みがあり,OSへログイ...
***140.clean-rwho
daily_clean_rwho_days
/var/rwho
UNIXにはwhoというコマンドがあって,現在そのホストにログ...
***199.clean-fax
7日間
/var/spool/fax
これはFAXサーバを使っていればファイルが溜まっている事も...
***310.accounting
/var/account/acct
これはセキュリティ上のコマンド履歴を残すacctを導入して...
**ステータス表示系
***400.status-disks
daily_status_disks_df_flags
dfコマンド
dfコマンドをdaily_status_disks_df_flagsにあるパラメータ...
sh-3.2# grep daily_status_disks_df_flags /etc/defaults/p...
daily_status_disks_df_flags="-l -h" # df(1) flags for c...
sh-3.2#
実際に実行するとこんな感じです.
sh-3.2# df -l -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 149Gi 82Gi 66Gi 56% /
/dev/disk1s3 298Gi 248Gi 50Gi 84% /Volumes/Jun...
sh-3.2#
***420.status-network
netstatコマンドを実行しています.
netstat -i
netstat -in
***430.status-rwho
rwhoコマンドを実行しています.
***500.daily~previous
昔のdailyコマンドと言う事で,これまで紹介して来たログ削...
***600.daily.server
このシェルはPerlになります.その名の通りサーバ用のdaily...
/etc/diskspacemonitor/daily.server.conf
/var/log/diskspacemonitor.log
daily.server.confに設定が書かれています.ファイルを圧縮...
filename pattern : # versions : threshold in MB : thresh...
まずは,このファイル.これはcompressが指定してあります.
/Library/Logs/AppleFileService/AppleFileService*.log*[0-...
このファイルはファイル共有サービスのログ
/Library/Logs/WebServer/*error_log.[0-9]*[0-9] : 0 : 50...
/Library/Logs/WebServer/*access_log.[0-9]*[0-9] : 0 : 50...
これはWebサーバ.実際には,/var/log/apache2へのリンク.
/var/log/diskspacemonitor.log : 5 : 50 : 9999 : roll : :
/var/log/slapd.log : 5 : 50 : 9999 : roll : syslogd : HUP
/Library/Logs/slapconfig.log : 5 : 50 : 9999 : roll : :
これはLDAP関連.
/var/log/ppp/vpnd.log : 5 : 50 : 9999 : roll : vpnd :...
VPNサーバとして使っているとログされる様です.
/var/log/httpd/mod_jk.log : 5 : 50 : 9999 : roll : :
/var/log/apache2/mod_jk.log : 5 : 50 : 9999 : roll : :
WebサーバでJavaアプリを連携して動かしている時のログ.
/var/log/securityproxy/calDAV_access.log : 5 : 50...
/var/log/securityproxy/cardDAV_access.log : 5 : 50...
/var/log/securityproxy/web_access.log : 5 : 50...
/var/log/securityproxy/httpd_error.log : 5 : 50...
/var/log/securityproxy/secure_proxy_login.log : 5 : 50...
/var/log/securityproxy/mail_access.log : 5 : 50...
/var/log/securityproxy/mail_error.log : 5 : 50...
カレンダーサーバ,メールサーバでセキュリティプロキシを...
/var/log/swupd/swupd_access_log : 5 : 50 : 9999 ...
/var/log/swupd/swupd_error_log : 5 : 50 : 9999 ...
/var/log/swupd/swupd_syncd_log : 5 : 50 : 9999 ...
これはソフトウェアアップデート関連です.Windows でいう...
***700.daily.server.mail
このシェルもPerl.
/var/log/mailaccess.log
/var/log/mail.log
/var/log/amavis.log
/var/log/clamav.log
/var/log/freshclam.log
/var/log/mailman/*
mailaccess.logとmail.logはPostfix関連のログ.amavis.log...
mailmanはメーリングリストのソフト.
amavisd-new
http://www.amavis.org
***999.local
このシェルは,このディレクトリにあるシェルを実行する事...
ページ名: