1752795 Members
6034 Online
108789 Solutions
New Discussion юеВ

Re: using sar

 
Danesh Qureshi
Regular Advisor

using sar

I have sar installed on a Tru64 Unix V5.1B server but when I issue the sar command from root for with a different option, I keep getting the same set of values.

See out of sar with 3 different options below:-
# sar 1 5 -c

OSF1 sinope V5.1 2650 alpha 20Aug2009

17:26:35 %usr %sys %wio %idle
17:26:36 0 0 0 100
17:26:37 0 0 0 100
17:26:38 0 0 0 100
17:26:39 0 0 0 100
17:26:40 0 1 0 98

Average 0 0 0 100
#
# sar 1 5 -u

OSF1 sinope V5.1 2650 alpha 20Aug2009

17:26:50 %usr %sys %wio %idle
17:26:51 0 0 0 100
17:26:52 0 0 0 100
17:26:53 0 0 0 100
17:26:54 0 0 0 100
17:26:56 0 20 0 80

Average 0 5 0 95
#
# sar 1 5 m

OSF1 sinope V5.1 2650 alpha 20Aug2009

17:27:12 %usr %sys %wio %idle
17:27:13 0 0 0 100
17:27:14 0 0 0 100
17:27:15 0 0 0 100
17:27:16 0 0 0 100
17:27:17 7 4 1 88

Average 1 1 0 98
#


I have read the sar man pages but I sar is not displaying the expected output.

Can someone elaborate for me please.
5 REPLIES 5
Victor Semaska_3
Esteemed Contributor

Re: using sar

Put the option before the interval and count.

# sar -c 1 5
# sar -u 1 5
There are 10 kinds of people, one that understands binary and one that doesn't.
Danesh Qureshi
Regular Advisor

Re: using sar

Thank you for correcting the synatax of sar command.

I want to be able to submit a cronjob to run sar reports every 5 minutes. The report sar report should include cpu,mem and disk usage.
Is there a way to setup in crontab to do this on Tru64?
Victor Semaska_3
Esteemed Contributor

Re: using sar

If I understand your question correctly, edit root's crontab with the command:

# crontab -e

Add the entry:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/opt/svr4/usr/bin/sar -udr 60 1

I used an interval of 60 seconds to give sar what I think is a reasonable amount of time to collect stat.s. Since output isn't directed to a file this example will e-mail the output to root.
There are 10 kinds of people, one that understands binary and one that doesn't.
Hein van den Heuvel
Honored Contributor

Re: using sar

While I appreciate someone wanting to use SAR as a tool they knwo from different platforms, i would encourage you to look at COLLECT to gather performance statistics for Tru64.

fwiw,
Hein.
Hein van den Heuvel
Honored Contributor

Re: using sar

Nevermind... You knew about COLLECT already.
I just noticed your other question mentioning it.

Hein.