Find the answer to your Linux question:
Results 1 to 2 of 2
Following is a output of command which shows cpu% of ABC machine (15 minute interval). Code: Host CPU% time ABC 50.55 14 : 15 ABC 50.25 14 : 15 ABC ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    17

    Scripting Help needed.


    Following is a output of command which shows cpu% of ABC machine (15 minute interval).

    Code:
    Host CPU% time
    ABC  50.55 14 : 15
    ABC  50.25 14 : 15
    ABC  50.1 14 : 15
    ABC  50.45 14 : 30
    ABC  50.25 14 : 30
    I would like to take above file as input .
    Notice that for every 15 minuate interval there are some entries generated.
    for example : for 14:15 there are 3 entries .
    for 14:30 there are 2 entries.

    I would like to get average of cpu% considering time.
    say.
    Code:
    ABC  50.3 14 : 15
    ABC  50.33 14 : 30
    How would i achieve this?
    Last edited by pinga123; 03-25-2011 at 06:45 AM.

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Take a look at awk.

Posting Permissions

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