Find the answer to your Linux question:
Results 1 to 2 of 2
How can I extract data using SAR in just a given time, like for example 03:00:00? Below is my syntax, but nothing comes out... >sar -s 03:00:00 -e 03:00:01 -r ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Location
    Manila
    Posts
    17

    Question SAR time extraction


    How can I extract data using SAR in just a given time, like for example 03:00:00? Below is my syntax, but nothing comes out...

    >sar -s 03:00:00 -e 03:00:01 -r | awk '{print $5}'

    I plan to get the RAM used percentage...

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,655
    Quote Originally Posted by Gideon2 View Post
    How can I extract data using SAR in just a given time, like for example 03:00:00? Below is my syntax, but nothing comes out...

    >sar -s 03:00:00 -e 03:00:01 -r | awk '{print $5}'

    I plan to get the RAM used percentage...
    From the sar man page:
    Code:
           -s [ hh:mm:ss ]
                  Set the starting time of the data, causing the sar command to extract records time-tagged at, or follow-
                  ing, the time specified. The default starting time is 08:00:00.  Hours must be given in 24-hour  format.
                  This option can be used only when data are read from a file (option -f ).
    Note that you need to read the data from a sar file in /var/log/sa. You aren't doing that. The log files are /var/log/sa/saNN (binary files), not /var/log/sa/sarNN, where NN is the number of the day of the month..
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •