UJP - Red Hat ES 3でaudit.dのログを消す

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ ハウツー の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - Red Hat ES 3でaudit.dのログを消す

Red Hat ES 3でaudit.dのログを消す

カテゴリ : 
ハウツー
ブロガー : 
ujpblog 2010/1/21 16:52
 Red Hat ES3で運営しているサーバで,messagesファイルにauditdのエラーが書き出されました.
auditd[xxxx]: output error

 auditdはシステム監査機能のデーモンですが,ディスクの空き容量が20%を切るまでログファイルを作成し続けます.
 dfコマンドで空き容量を確認したら空き容量が85%だったので,これが原因でしょう.
/var/log/audit.dを確認すると,大量のデータが保存されていました.
 削除前に,デーモンを停止します.

root@ mars audit.d]# ps -ef|grep auditd
root 1627 1 0 16:02 ? 00:00:00 /sbin/auditd
root 2249 2168 0 16:26 pts/1 00:00:00 grep auditd
[root@ mars audit.d]# /etc/init.d/audit stop
Shutting down audit subsystem [ OK ]
[root@ mars audit.d]# ps -ef|grep auditd
root 2257 2168 0 16:27 pts/1 00:00:00 grep auditd
[root@ mars audit.d]#

 仮に退避ディレクトリを作成し,不要と思われるデータを移動します.
[root@ mars audit.d]# pwd
/var/log/audit.d
[root@ mars audit.d]#
[root@ mars audit.d]# mkdir old
[root@ mars audit.d]# mv save.* old/.
[root@ mars audit.d]# ls -lah
合計 81M
drwx------ 3 root root 8.0K 1月 21 16:30 .
drwxr-xr-x 19 root root 4.0K 1月 21 16:08 ..
-rw------- 1 root root 20M 1月 12 20:10 bin.0
-rw------- 1 root root 20M 1月 14 13:15 bin.1
-rw------- 1 root root 20M 1月 16 06:25 bin.2
-rw------- 1 root root 20M 1月 21 16:27 bin.3
drwxr-xr-x 2 root root 8.0K 1月 21 16:30 old
[root@ mars audit.d]#

 auditdを再開して,ログを確認します.
[root@ mars audit.d]# /etc/init.d/audit start
Starting audit subsystem [ OK ]
[root@ mars audit.d]# ps -ef|grep auditd
root 2316 1 0 16:32 ? 00:00:00 /sbin/auditd
root 2320 2168 0 16:32 pts/1 00:00:00 grep auditd
[root@ mars audit.d]# ls -la
合計 82036
drwx------ 3 root root 8192 1月 21 16:30 .
drwxr-xr-x 19 root root 4096 1月 21 16:32 ..
-rw------- 1 root root 20971520 1月 12 20:10 bin.0
-rw------- 1 root root 20971520 1月 14 13:15 bin.1
-rw------- 1 root root 20971520 1月 16 06:25 bin.2
-rw------- 1 root root 20971520 1月 21 16:32 bin.3
drwxr-xr-x 2 root root 8192 1月 21 16:30 old
[root@ mars audit.d]#

 bin.3の更新日が変更されている事が確認できました.あとはoldディレクトリにある古いログを,削除等で退避して終了です.audit.dを使わないのであれば,chkconfigでサービスを停止するのもありでしょう.

トラックバック

トラックバックpingアドレス トラックバックpin送信先urlを取得する

広告スペース
Google