Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Load Monitor

by blackmateria (Chaplain)
on Nov 02, 2001 at 21:02 UTC ( [id://122851]=note: print w/replies, xml ) Need Help??


in reply to Load Monitor

I see two problems with your code:
  1. system("cat /proc/loadavg") does in fact print to stdout, but that doesn't mean you read its output from stdin. Instead of your cat+while loop+split combo, you want: @loads = split /\s+/, scalar `cat /proc/loadavg` ;
  2. You're using $loads[1] to represent the first element of the array. I think you want $loads[0] instead.
Hope this helps!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://122851]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-03-28 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found