Solved

Format the load average of a linux server using php?

Posted on 2010-09-05
5
428 Views
Last Modified: 2012-05-10
Hello

I'm using the below code to display the load of my linux server.

$info = file_get_contents('/proc/loadavg');

Open in new window


I'd like to format the result which is this: (changes per load of course)  0.71 0.54 0.54 1/78 31161

I'd even be fine with knowing what each number means since then I can just add what each means (each set, I notice is separated by a space) above the printed result.

Thanks
Rob
0
Comment
Question by:showmeurgoods
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 33608477
0
 

Author Comment

by:showmeurgoods
ID: 33608486
Thanks santoshmotwani, but I've its not the output, I have that down correct.  I actually came across that post prior to posting here.

I need to know either what each set of numbers refers to, or how to format them differently to show up better then 5 sets of numbers.

Thanks
Rob
0
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 250 total points
ID: 33608858
The first three columns measure CPU and IO utilization of the last one, five, and 10 minute periods. The fourth column shows the number of currently running processes and the total number of processes. The last column displays the last process ID used.


0
 

Author Closing Comment

by:showmeurgoods
ID: 33609200
This 100% answers my question
0
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 33609286
Cheers
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
The viewer will learn how to count occurrences of each item in an array.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now