• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how do I get processor usage info?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do I get processor usage info?


  • Subject: Re: how do I get processor usage info?
  • From: Andrew Oliver <email@hidden>
  • Date: Wed, 30 Jun 2004 21:28:56 -0700

Funnily enough, this doesn't work.

For some reason that I can't quite see, this always reports 100% processor
usage for the first hit. This can be seen by the command:

top -l2|awk '/Load Avg/ { print $0 };'

(or sed, perl, etc., etc. - anything you like to use to parse text).

The first hit is always 100% utilization (or, 0% idle, depending on your
point of view), but the second one looks more feasible.

The problem with an ssh-based solution is that you need to
authenticate/login to the system to run it. Using key-based logins mitigates
that somewhat, but isn't the most straightforward solution.
One related option is to write a shell script that gets the CPU load and
link it via xinetd. You can then use nc via do shell script to connect to
the machine, run the script and grab the results.

Andrew
:)

On 6/30/04 9:07 PM, "Gnarlodious" <email@hidden> wrote:

> Entity Jose Moran spoke thus:
>
>> I need to get the processor usage percent in an script, just the
>> instant I run it..... in several machines... remotely.
>
> You can logon to the remote machine with SSH and use:\
>
> top -l1 | sed -n '/Load Avg:/p'
>
> Maybe you can do it in Applescript with remote Events but it sounds
> complicated.
>
> -- Gnarlie
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: how do I get processor usage info? (From: Gnarlodious <email@hidden>)

  • Prev by Date: Re: how do I get processor usage info?
  • Previous by thread: Re: how do I get processor usage info?
  • Next by thread: Re: Word 2004 and applescript?
  • Index(es):
    • Date
    • Thread