lastcomm
0.改定履歴
- 1999.03.02 初版
- 1999.03.08 第4章追加
1.はじめに
このドキュメントは,Solaris2.xで,コマンドの監視を行なうlastcommの設定と,使用方法の説明を行なう.
2.設定
アカウント(課金)のコマンドとして /usr/lib/acct 配下のコマンドや lastcomm などはあります。
また、2.X のアカウントの設定は以下のように行なってください。
- 1)まず、/etc/rc0.d/K22acct,/etc/rc2.d/S22acct が存在しないことを確認し、/etc/init.d/acct ファイルをシンボリック・リンクします。
ln -s /etc/init.d/acct /etc/rc0.d/K22acct ln -s /etc/init.d/acct /etc/rc2.d/S22acct |
- root の crontab ファイルにアカウント用のエントリを追加します。
0 * * * * /usr/lib/acct/ckpacct 0 1 * * 1-5 /usr/lib/acct/dodisk 0 2 * * 1-5 /usr/lib/acct/runacct 2> /var/adm/acct/nine/fd2log 30 5 1 * * /usr/lib/acct/monacct |
以上の設定で reboot してください。また、crontab での時間などの設定は使用しているシステムにあわせて、設定してください。
設定については、Sファミリーニュース(No.62)にも掲載されていますので
ご参照ください。コマンドについてはオンラインマニュアルをご参照ください。
3.利用方法
lastcommとコマンドを入力すれば,すべてのコマンドの記録が表示される.
# lastcomm | more lastcomm root pts/2 0.19 secs Mon Mar 8 13:35 more root pts/2 0.03 secs Mon Mar 8 13:35 lastcomm root pts/2 0.52 secs Mon Mar 8 13:35 alias root pts/2 0.03 secs Mon Mar 8 13:35 expr root pts/2 0.04 secs Mon Mar 8 13:35 cat root pts/2 0.01 secs Mon Mar 8 13:35 quota root pts/2 0.01 secs Mon Mar 8 13:35 |