[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: getloadavg and proc filesystem

Andrew Miehs wrote:
I am looking at writing some monitoring scripts from data out of the / proc filesystem for monitoring cpu, idle, etc. I have had a look at the source code for getloadavg.c, and wondering what happens if the kernel changes the data in /proc/loadavg while
> getloadavg is  doing its stuff.

If you want to monitor just cpu utilisation, the load average isn't going to be a great measure; IO slowdown will 'break' the load average, for example.

You are probably better off looking at /proc/stat.

https://sourceforge.net/projects/loadinfo is an awful hack which might be a good starting point.

Reply to: