Sar: Difference between revisions

From ICO wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 20: Line 20:


Läbi selle saab kergesti infot erinevate süsteemijõudluse kohta : näiteks CPU(protsessori) aktiivsus, mälu/pagefile'i suurus, device load, võrgu kasutus.
Läbi selle saab kergesti infot erinevate süsteemijõudluse kohta : näiteks CPU(protsessori) aktiivsus, mälu/pagefile'i suurus, device load, võrgu kasutus.
Kõik saadud info talletatakse defaultina faili  /var/log/sa/sadd


{|style="background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey" align=centre
{|style="background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey" align=centre
Line 25: Line 26:
|}
|}


Näidisväljund : cpu %usr  %sys  %nice  %idle                                   _cpu_
[-e time] Ilma aja ette määramiseta, näitab süsteemi keskmist kasutust alates ajast, kui süsteem käivitati.
[-i sec] Ka on soovitatav ette näidata intervall, mille tagant võetakse infot uuesti, kui -i 0 , siis antakse ette keskmine statistika süsteemi üleslaadimisest saadik.
kui -i parameeter jäetakse tühjaks, jätkatakse raportite genereerimist.
 
If the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously. The collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the /var/log/sa/sadd file, where the dd parameter indicates the current day. By default all the data available from the kernel are saved in the data file.
 
Näidisväljund ilma time-i ja intervalli (-i) kasutamata
        : cpu %usr  %sys  %nice  %idle   _cpu_
           all  28    10      0    62
           all  28    10      0    62
                 0    39    8      0    52
                 0    39    8      0    52
Line 38: Line 46:
-i sec Selects data at intervals as close as possible to sec seconds.
-i sec Selects data at intervals as close as possible to sec seconds.


Näide:
Lisaks on olemas command sag, mis näitab graafiliselt seda infot binaarfailist, mis tekitati eelmise sar-i commandi jooksutamisega.
Süntaks:
{|style="background:lightyellow;width:500px;margin:3px;border:1px solid lightgrey" align=centre
| style="padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;" |sag [-e time] [-f file] [-i sec] [-s time] [-T term] [-x spec] [-y spec] ]
|}
-e time Select data up to time . Default is 18:00.
-f file Use file as the data source for sar . Default is the current daily data file /usr/adm/sa/sadd.
-i sec Select data at intervals as close as possible to sec seconds.
-s time Select data later than time in the form hh[:mm]. Default is 08:00.
-T term Produce output suitable for terminal term. See tplot for known terminals. Default for term is $TERM.
-x spec x axis specification with spec in the form:
name[op name]...[lo hi]
name is either a string that will match a column header in the sar report, with an optional device name in square brackets, for example, r+w/s[dsk-1], or an integer value. op is + - * or / surrounded by blank spaces. Up to five names may be specified. Parentheses are not recognized. Contrary to custom, + and - have precedence over * and /. Evaluation is left to right. Thus, A/A+B*100 is evaluated as (A/(A+B))*100, and A+B/C+D is (A+B)/(C+D). lo and hi are optional numeric scale limits. If unspecified, they are deduced from the data.
Enclose spec in double-quotes ("") if it includes white space.


A single spec is permitted for the x axis. If unspecified, time is used.
-y spec y axis specification with spec in the same form as for -x. Up to 5 spec arguments separated by a semi-colon (;) may be given for -y. The -y default is:


-y"%usr0100;%usr+%sys0100;%usr+%sys+%wio0100"


= Kasutatud materjalid // Edasi uurimiseks, kellel soovi =
= Kasutatud materjalid // Edasi uurimiseks, kellel soovi =

Revision as of 23:33, 3 January 2013

Autor: Matis Palm A21

Sar(system activity monitor) ehk süsteemi aktiivsuse monitor on algselt Solarisega seotud käsk, mida kasutatakse nüüd üldisemalt UNIX-i laadsete süsteemide peal. Linuxi peal saab sar-i kasutada läbi sysstat'i või atsar'i paketi(package).

Kasutamiseks tuleb editida /etc/default/sysstat faili, et lubataks süsteemiinfo kogumine(Kui see ei ole juba lubatud)

Seda võime teha kasutades nano tekstiredaktorit, omades piisavalt õiguseid (näites kasutan sudo't):

sudo nano /etc/default/sysstat
"ENABLED=false" asemel tuleb kirjutada "ENABLED=true"

Läbi selle saab kergesti infot erinevate süsteemijõudluse kohta : näiteks CPU(protsessori) aktiivsus, mälu/pagefile'i suurus, device load, võrgu kasutus. Kõik saadud info talletatakse defaultina faili /var/log/sa/sadd

sar [-flags] [ -e time ] [ -f filename ] [-i sec ] [ -s time ]

[-e time] Ilma aja ette määramiseta, näitab süsteemi keskmist kasutust alates ajast, kui süsteem käivitati. [-i sec] Ka on soovitatav ette näidata intervall, mille tagant võetakse infot uuesti, kui -i 0 , siis antakse ette keskmine statistika süsteemi üleslaadimisest saadik. kui -i parameeter jäetakse tühjaks, jätkatakse raportite genereerimist.

If the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously. The collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the /var/log/sa/sadd file, where the dd parameter indicates the current day. By default all the data available from the kernel are saved in the data file.

Näidisväljund ilma time-i ja intervalli (-i) kasutamata

        : cpu %usr  %sys  %nice  %idle   _cpu_
         all   28    10      0     62
                0    39     8      0     52
                1    26     9      0     66
                2    27     8      0     65
                3    21    14      0     65

NB!tegemist on 4 tuumalise protsessoriga, ehk näidatakse protsessorite tuumade kasutust eraldi igale tuumale


-f filename Uses filename as the data source for sar. The default is the current daily data file /var/adm/sa/sadd. -e time Selects data up to time. The default is 18:00. -i sec Selects data at intervals as close as possible to sec seconds.



Kasutatud materjalid // Edasi uurimiseks, kellel soovi