Format the load average of a linux server using php?

Posted on 2010-09-05
Last Modified: 2012-05-10

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.

Question by:showmeurgoods
  • 3
  • 2
LVL 16

Expert Comment

ID: 33608477

Author Comment

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.

LVL 16

Accepted Solution

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.


Author Closing Comment

ID: 33609200
This 100% answers my question
LVL 16

Expert Comment

ID: 33609286

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

747 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