Solved

Format the load average of a linux server using php?

Posted on 2010-09-05
5
447 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

751 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