Sar: Difference between revisions

From ICO wiki
Jump to navigationJump to search
m (a)
No edit summary
Line 11: Line 11:
Kasutamiseks tuleb editida /etc/default/sysstat faili, et lubataks süsteemiinfo kogumine(Kui see ei ole juba lubatud)
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 :
Seda võime teha kasutades nano tekstiredaktorit, omades piisavalt õiguseid (näites kasutan sudo't):
{|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
| style="padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;" | nano /etc/default/sysstat
| style="padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;" | sudo nano /etc/default/sysstat
|}
|}


{|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
| style="padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;" | "ENABLED=FALSE" asemel tuleb kirjutada "ENABLED=TRUE"
| style="padding:0px 0px 0px 80px;font-family:courier;font-size:8pt;" | "ENABLED=false" asemel tuleb kirjutada "ENABLED=true"
|}
|}


Line 59: Line 59:
-y"%usr0100;%usr+%sys0100;%usr+%sys+%wio0100"
-y"%usr0100;%usr+%sys0100;%usr+%sys+%wio0100"


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


*http://sebastien.godard.pagesperso-orange.fr/man_sar.html
*http://sebastien.godard.pagesperso-orange.fr/man_sar.html
*http://www.computerhope.com/unix/usar.htm
*http://www.itworld.com/sar-performance-analysis-nlsunix-080529
*http://linux.die.net/man/1/sar
*http://www.thegeekstuff.com/2011/03/sar-examples/
*http://www.cyberciti.biz/tips/identifying-linux-bottlenecks-sar-graphs-with-ksar.html
*http://www.thegeekstuff.com/2011/03/sar-examples/
*http://www.linuxjournal.com/content/sysadmins-toolbox-sar
*http://linux.101hacks.com/monitoring-performance/sar-command-examples/
*http://www.ibm.com/developerworks/aix/library/au-unix-perfmonsar.html
*http://www.softprayog.in/tutorials/sar-in-linux
*http://www.expertslogin.com/linux-administration/linux-system-performance-monitoring-using-sar-command/
*http://www.linuxcommand.org/man_pages/sar1.html
*http://queforum.com/blogs/maha/1131-linux-sar-command-monitoring-performance-cpu.html

Revision as of 21:25, 2 December 2012

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õrk.

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

-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.

Näide:


Lisaks on olemas command sag, mis näitab graafiliselt seda infot binaarfailist, mis tekitati eelmise sar-i commandi jooksutamisega.

Syntax

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