Unix/Solaris °ü·Ã°Ô½ÃÆÇ

2001/11/03(11:52) from 210.117.182.46
ÀÛ¼ºÀÚ : °­ÁÙ±â (jkkang65@hanmail.net) Á¶È¸¼ö : 2498 , ÁÙ¼ö : 45
Re: [Solaris 2.x] lastcomm ¼³Á¤¹æ¹ý - ¿µ¹®¹öÀü
--------------------------------------------------------------------------------

Turning on process accounting
 Starting and stopping process accounting.

The process accounting mechanism is started with the accton command. To start process accounting from the command prompt, enter the following command, which can be run as root:

/usr/lib/acct/accton /var/adm/pacct

This enables process accounting with data being written to the file /var/adm/pacct. You should notice an immediate change to the size of the process accounting file once accounting has been enabled. Executing the accton command provides a history of processes executed since process accounting was started, along with a number of other fields related to the execution of each process.

To turn off process accounting from the command line, issue the above command without the file parameter, as follows:

/usr/lib/acct/accton

 Initiating process accounting at boot time.

The command that started process accounting runs until it is turned off or until the machine has rebooted. To have the process accounting continue after a reboot, you need to add the accton command with the file parameter to one of the boot scripts.

To add the command, create a new file in the /etc/rc3.d directory with a name of the form SNNacct.sh where NN is a number greater than 25 but less than 99 that does not conflict with any other numbers in that directory. Then add the first command line above to the new file, save it, and exit. This enables process accounting following a reboot of the system.

 Rotating process accounting files.   

Process accounting files can become very large, very quickly. You need to rotate these files, allowing you to keep a certain number of days' worth of information while in turn limiting the amount of space consumed by the accounting file.

For information on rotating log files on Solaris using newsyslog, see the implementation "Using newsyslog to rotate files containing logging messages on systems running Solaris 2.x."


--------------------------------------------------------------------------------

Related
Information   Using process accounting information.

Process accounting can create a great deal of information. As a result, the logs can be difficult to process effectively. For information on one of the tools that can help to filter and reduce the amount of information to a more manageable size, see the implementation "Installing and configuring spar 1.2 on systems running Solaris 2.x."


--------------------------------------------------------------------------------


Copyright 2000 Carnegie Mellon University
CERT is registered in the U.S. Patent and Trademark Office.



Page revised: March 2, 2000

Modify Delete Post Reply Backward Forward List
Powered by Kang Jul Ki