⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unx38.htm

📁 Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<P>LINE</P>

<TD>

<P>The port that was accessing the system.</P>

<TR>

<TD>

<P>MINUTES</P>

<TD>

<P>The number of minutes the line was in usage during the daily period.</P>

<TR>

<TD>

<P>PERCENT</P>

<TD>

<P>The number of minutes in use divided by TOTAL DURATION. TOTAL DURATION is the number of minutes the system was in multiuser mode.</P>

<TR>

<TD>

<P># SESS</P>

<TD>

<P>The number of times the port was accessed to log in to the system.</P>

<TR>

<TD>

<P># ON</P>

<TD>

<P>The number of times the port was used to log in the user into the system. Hey, if you see that the # SESS is very large compared to the # ON, then you have a problem. There might be someone hacking your system on that port.</P>

<TR>

<TD>

<P># OFF</P>

<TD>

<P>The number of logoffs that occurred at that port and the number of interrupts like Ctrl-c, EOF, etc.</P></TABLE>

<H4 ALIGN="CENTER">

<CENTER><A ID="I20" NAME="I20">

<FONT SIZE=3><B>Daily Usage Report</B>

<BR></FONT></A></CENTER></H4>

<P>The Daily Usage Report can be found in the /var/adm/acct/nite/daytacct file.

<BR></P>

<PRE>$ cat /var/adm/acct/nite/daytacct

Apr 06 01:33 1994  DAILY USAGE REPORT FOR excelsior Page 1

     LOGIN   CPU (MINS)  KCORE-MINS   CONNECT (MINS)  DISK    # OF   # OF  # DISK  FEE

UID  NAME   PRIME NPRIME PRIME NPRIME  PRIME  NPRIME  BLOCKS  PROCS  SESS  SAMPLES

0    TOTAL   6     13     7     14      165      67      0     1020     6      0    0

0    root    3      7     1      8        0       0      0      400     0      0    0

3    sys     0      3     0      1        0       0      0       51     0      0    0

4    adm     0      1     0      1        0       0      0      251     0      0    0

5    uucp    0      0     0      0        0       0      0       60     0      0    0

1091 carolyn 2      1     4      3      140      47      0      249     2      0    0

2155 zach    1      1     2      1       25      20      0        9     4      0    0

$</PRE>

<P>Here it is column by column:

<BR></P>

<TABLE BORDER>

<TR>

<TD>

<P>UID</P>

<TD>

<P>The user's identification number.</P>

<TR>

<TD>

<P>LOGIN NAME</P>

<TD>

<P>The user's name.</P>

<TR>

<TD>

<P>CPU (MINS)</P>

<TD>

<P>The amount of time the user's program required the use of CPU. This is rounded up to the nearest minute.</P>

<TR>

<TD>

<P>KCORE-MINS</P>

<TD>

<P>The amount of memory per minute used to run the programs. This is rounded up to the nearest kilobyte.</P>

<TR>

<TD>

<P>CONNECT (MINS)</P>

<TD>

<P>Total time the user was actually connected to the system.</P>

<TR>

<TD>

<P>DISK BLOCKS</P>

<TD>

<P>The number of disk blocks used. This sum is placed by dodisk.</P>

<TR>

<TD>

<P># OF PROCS</P>

<TD>

<P>The number of processes the user executed.</P>

<TR>

<TD>

<P># OF SESS</P>

<TD>

<P>The number of sessions the user incurred by logging in to the system.</P>

<TR>

<TD>

<P># DISK SAMPLES</P>

<TD>

<P>The number of times acctdusg or diskusg was run to cumulate the average number of DISK BLOCKS.</P>

<TR>

<TD>

<P>FEE</P>

<TD>

<P>The total amount of usage charges accessed to the user for this given period.</P></TABLE>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> You might have noticed that I didn't mention PRIME and NPRIME in the above list. PRIME is the prime-time hours for processing, and NPRIME is the non-prime hours for processing. For instance, holidays 

would not be considered prime-time hours. You would expect that a majority of your users would not be on the system during the holiday. The file /etc/acct/holidays allows you to tailor the non-prime times for your company. Why would this be important? I 
want to bill my customer a premium rate for using my system during the days or during the heavy processing hours. I will charge a lower rate at non-prime hours. For example, my prime-time hours are from 8:00 a.m. (800 hours) to 6:30 p.m. (1830 hours) for 
1994. I would add the following entry in the /etc/acct/holidays file.

<BR>

<BR># Prime Time Hours for 1994

<BR>1994  0800  1830

<BR>

<BR>Here is a sampling of my /etc/acct/holidays file:

<BR>

<BR>$ cat /etc/acct/holidays

<BR>#

<BR># Holidays

<BR>#

<BR>0101  New Year's Day

<BR>0528  Memorial Day

<BR>0704  Independence Day

<BR>#

<BR># Prime Time Hours for 1994

<BR>#

<BR>1994  0800  1830

<BR>$

<BR></NOTE>

<HR ALIGN=CENTER>

<H4 ALIGN="CENTER">

<CENTER><A ID="I21" NAME="I21">

<FONT SIZE=3><B>Daily Command Summary Report and Total Command Summary Report</B>

<BR></FONT></A></CENTER></H4>

<P>The Daily Command Summary Report can be found in the /var/adm/acct/nite/daycms file.

<BR></P>

<PRE>$ cat /var/adm/acct/nite/daycms

Apr 06 01:32 1994  DAILY COMMAND SUMMARY REPORT FOR excelsior Page 1

                                     TOTAL COMMAND SUMMARY

COMMAND NUMBER    TOTAL  TOTAL    TOTAL   MEAN   MEAN     HOG    CHARS  BLOCKS

NAME     CMDS  KCOREMIN CPU-MIN REAL-MIN SIZE-K CPU-MIN  FACTOR  TRNSFD   READ

TOTALS   2050      3.57   21.59   157.57   0.21    0.02   0.14  6570519   2726

csh       171      2.50    2.56    10.71   0.45    0.02   0.05   257429    212

grep       14      0.10     .56     2.71   0.40    0.01   0.34    17537     42

more        5      0.04    0.09     1.01   0.59    0.01   0.45    25414      2

awk         2      0.01    0.12     1.71   0.15    0.01   0.55      529      5

  .

  .

  .

$</PRE>

<P>The Total Command Summary Report looks like the preceding report with one exception. It is a monthly summary showing total accumulated since last month or execution of monacct. This report can be seen in the /var/adm/acct/sum/cms file. Here are the 
column-by-column details.

<BR></P>

<TABLE BORDER>

<TR>

<TD>

<P>COMMAND NAME</P>

<TD>

<P>The name of the command.</P>

<TR>

<TD>

<P>NUMBER COMMANDS</P>

<TD>

<P>The total number of times the command has been executed.</P>

<TR>

<TD>

<P>KCOREMIN</P>

<TD>

<P>The total cumulative kilobytes segments used by the command. </P>

<TR>

<TD>

<P>TOTAL CPU-MIN</P>

<TD>

<P>The total processing time in minutes.</P>

<TR>

<TD>

<P>REAL-MIN</P>

<TD>

<P>The actual processing time in minutes.</P>

<TR>

<TD>

<P>MEAN SIZE-K</P>

<TD>

<P>The mean of TOTAL KCOREMIN divided by execution.</P>

<TR>

<TD>

<P>MENU CPU-MIN</P>

<TD>

<P>The mean of executions divided by total processing time in minutes.</P>

<TR>

<TD>

<P>HOG FACTOR</P>

<TD>

<P>The total processing time divided by elapsed time. This is the utilization ratio of the system.</P>

<TR>

<TD>

<P>CHARS TRNSFD</P>

<TD>

<P>The total number of reads and writes to the file system.</P>

<TR>

<TD>

<P>BLOCKS READ</P>

<TD>

<P>The total number of physical block reads and writes.</P></TABLE>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> For purposes of illustration, I have deleted the PRIME and NPRIME column from this report. On your system, these will be there for you to view. See the previous note box about what PRIME and NPRIME 
represent.

<BR></NOTE>

<HR ALIGN=CENTER>

<H4 ALIGN="CENTER">

<CENTER><A ID="I22" NAME="I22">

<FONT SIZE=3><B>Last Login Report</B>

<BR></FONT></A></CENTER></H4>

<P>The Last Login Report can be found in the /var/adm/acct/sum/loginlog file. This report has the last login that your users have made on your system. Any entry that you find that is several months old could be a candidate to purge from your system.

<BR></P>

<PRE>$ cat /var/adm/acct/nite/daycms

Apr 06 01:32 1994  LAST LOGIN Page 1

   ...

93-01-05 briano    94-01-11 philp     94-02-21 deanm     94-03-01 stacyh    

93-01-13 jordang   94-01-11 kittyw    94-02-21 richards  94-03-01 zachp     

93-10-03 bradj     94-01-11 cindym    94-02-21 davidb    94-03-01 jimg      

93-10-07 deborahf  94-01-11 franh     94-02-21 seanm     94-03-11 mitzig    

93-11-05 gaylej    94-01-21 gregc     94-02-21 maryi     94-03-12 chrisd    

93-12-05 keithd    94-01-21 wayneb    94-02-24 kristih   94-03-17 lynetteq  

93-12-11 markt     94-01-21 matthewu  94-02-24 sandrad   94-03-20 sharonc   

93-12-13 robh      94-01-21 philk     94-02-24 gregb     94-03-21 margaret  

93-12-25 cindyk    94-01-21 dianah    94-02-24 daniels   94-03-21 paulas    

94-01-05 deniseo   94-01-21 richc     94-02-24 lauric    94-03-22 mikes     

94-01-05 gingera   94-02-05 carolynp  94-02-24 keitho    94-03-25 scottp    

94-01-05 greggb    94-02-13 jimg      94-02-24 joew      94-04-01 kathye    

94-01-05 katyo     94-02-15 matthewh  94-02-24 virgilp   94-04-05 daveh     

94-01-05 viginiap  94-02-15 douga     94-03-01 briant    94-04-08 stepht    

94-01-05 mollyp    94-02-15 cameront  94-03-01 sneakerp  94-04-10 sugerp    

94-01-05 bwhitmer  94-02-17 beths     94-03-01 carola    94-04-11 rosemari  

   .

   .

   .

$</PRE>

<H3 ALIGN="CENTER">

<CENTER><A ID="I23" NAME="I23">

<FONT SIZE=4><B>Summary</B>

<BR></FONT></A></CENTER></H3>

<P>In this chapter, you learned how to set up the accounting system to track your users and the processes they run. UNIX System Accounting can be a useful tool to help you tune your system and to plan for future expansion of hard disks, memory, and 
processors. This is the most common usage of the accounting system. If you are a provider for UNIX resource, such as connections to the Internet, the accounting system allows you to bill those users for the use of your system.

<BR></P>

<P><A HREF="unx37.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unx39.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -