Acct--accounting Utilities Statistics Tool

Source: Internet
Author: User
Tags printable characters

Translation from info AC, limited level, for reference only ...


Acct is a tool set that records user connection times and process execution data. It includes:
AC: Statistics login account information
Accton: Turn process logging on or off
Last: Show logged in user
Lastcomm: Show used commands
SA: Logging of statistical processes
DUMP-ACCT: Print Acct/pacct file in human-readable form
Dump-utmp: Print utmp file in human-readable form


Acct files commonly located in/var/log/pacct,wtmp files are generally located in/var/log/wtmp. You can view the file location by viewing the "--help" parameter of any command. Login statistics file is wtmp, process statistics file is Acct,savacct,usracct


1, AC: Print the user connection time data. AC is the time (in hours) that the connection is printed based on the wtmp file.
-D: Print out the connection time for each day
-P: Print out time for different user connections
--reboots: Contains reboot user connection time (reboot user connection time is System boot to shutdown)


Note: AC View connection time there is a question, that is, how AC calculates the connection time. In the output can see 40.50, such as exceeding 24 of the value, do not know what the meaning of the representative.

2. Accton: Turn process record on or off
Accton on|off| Accountingfile

3, Last: Print the user connection information by viewing the wtmp file. Last can be followed by a lot of things, for example: Last root console will print the root connection information and the information connected from the console (or the relationship)
Options
-Y: Print year
-I: Print IP address instead of domain name


4, Lastcomm: Print the information before executing the command, if not add any parameters, print ' acct ' File all the commands. Lastcomm can be followed by command name, user name, terminal name, and only the entries containing these will be displayed. For example ' Lastcomm a.out tty0 ', will print any entry in the command name, user name, terminal name that contains ' a.out ' or ' tty0 '. If you want to print the entry of user root in the terminal tty0 Execution a.out command, enter: Lastcomm--strict-match a.out Root tty0, the order of the parameters is not very important.
Lastcomm printed entries include the command name that generated the process, flags (S: Commands executed by the superuser, F: Commands executed after the fork, commands terminated because of the creation of the core file; X: The command terminated by Sigterm), the user name, and the time the process exited.
Options:
--user NAME: A list of records for a user
--command NAME: A list of records for a command
--tty NAME: A list of records for a terminal

5. Sa:sa Statistics records information about the commands executed in the "acct" File. In addition, it condenses these data into ' savacct ' files. This file contains the number of command calls and the use of resources. You can also count on a per-user basis, and SA will save this information in the ' Usracct ' file.
If the SA command does not have any parameters, all command information for the Acct file is printed. If the command name contains non-printable characters, or is called only once, the SA will place them in the ' ***other ' group. The total number of commands is displayed as a blank command name.
fields in the command output:
' CPU ': The time the system and the user use the CPU
' Re ': ' Real time ' in CPU seconds
' Avio ': The average number of I/O operations per command.
' Tio ': Total number of I/O operations
' K ': Cpu-time averaged core usage,in 1k units
Options:
-A: Show all commands instead of ' **other ' instead
-D: Sort the display in ' Avio ' order.

6, Dump-acct: Print the Acct file in human-readable form.
Output format, between items with ' | ' Separated:
Name of the command
version of the Acct file
User Time
System time
Run time
User ID
Group ID
Memory usage
Number of characters passed to I/O
Process ID
Parent Process ID


Acct--accounting Utilities Statistics Tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.