Sponsored Content
Top Forums Shell Programming and Scripting Create a list of load averages Post 302606713 by jim mcnamara on Monday 12th of March 2012 01:30:12 PM
Old 03-12-2012
Code:
#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10
do
     cat /proc/loadavg
     sleep 60
done > /tmp/t.lis
awk '{ sum +=$1; print $1 } END {print sum/NF}'  /tmp/t.lis > avg.lis
# use the avg variable

This User Gave Thanks to jim mcnamara For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Sun: High kernel usage & very high load averages

Hi, I am seeing very high kernel usage and very high load averages on my system (Although we are not loading much data to our database). Here is the output of top...does anyone know what i should be looking at? Thanks, Lorraine last pid: 13144; load averages: 22.32, 19.81, 16.78 ... (4 Replies)
Discussion started by: lorrainenineill
4 Replies

2. Shell Programming and Scripting

Need help in wrting Load Script for a Load-Resume type of load.

hi all need your help. I am wrting a script that will load data into the table. then on another load will append the data into the existing table. Regards Ankit (1 Reply)
Discussion started by: ankitgupta
1 Replies

3. UNIX for Dummies Questions & Answers

create and load my own .profile

Hello to everyone, This is my first that I use any group in order to find a reply to my question. I would really like your help!!! Do you know how can I create my own .profile file in unix (not edit the existing one) and how can I load it when i open a new bash? I would like those settings... (1 Reply)
Discussion started by: unbalanced
1 Replies

4. Shell Programming and Scripting

shell script to create disk load

friends , need a shell script to create a disk load. can any one pls guide me with how this can be implemented. Pls provide the concept. from there i will try to design my script. (3 Replies)
Discussion started by: achak01
3 Replies

5. Shell Programming and Scripting

Calculate Averages !

Hi, I have a file with more than 2,000 rows like this: 05/26/2011,1200,1500 I would like to create a awk shell script that calculate the price average of the second and third field each 5,10 and 20 rows or ask me for the values, starting at first row. Finally compare the average value... (1 Reply)
Discussion started by: csierra
1 Replies

6. Solaris

Sparc Solaris 10 load averages

our server is running oracle database, it has: load average: 1.77, 1.76, 1.73 using only one cpu. is that too high? thanks. (4 Replies)
Discussion started by: orange47
4 Replies

7. How to Post in the The UNIX and Linux Forums

Daily averages...

I have date file like below.. 1995 1 2 10 29 38.6706 -6.53823 41.9201 1995 1 2 10 29 -49.2477 -4.59733 17.2704 1995 1 2 10 29 -49.2369 -4.48045 8.61348 1995 1 3 8 48 -42.2643 ... (3 Replies)
Discussion started by: athithi
3 Replies

8. Programming

NodeMCU ESP8266 Blynk SSL Application for Linux Server Load Averages

Here is a useful SSL (HTTPS) application for anyone with a remote Linux server they want to keep an eye on using Blynk and the NodeMCU ESP8266. This little app also works (have tested as well) on the WeMos D1 ESP8266 Arduino board. The NodeMCU setup could not be easier, just find a... (8 Replies)
Discussion started by: Neo
8 Replies
GETLOADAVG(3)						     Linux Programmer's Manual						     GETLOADAVG(3)

NAME
getloadavg - get system load averages SYNOPSIS
#define _BSD_SOURCE #include <stdlib.h> int getloadavg(double loadavg[], int nelem); DESCRIPTION
The getloadavg() function returns the number of processes in the system run queue averaged over various periods of time. Up to nelem sam- ples are retrieved and assigned to successive elements of loadavg[]. The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. RETURN VALUE
If the load average was unobtainable, -1 is returned; otherwise, the number of samples actually retrieved is returned. VERSIONS
This function is available in glibc since version 2.2. CONFORMING TO
Not in POSIX.1-2001. Present on the BSDs and Solaris. SEE ALSO
uptime(1), proc(5), feature_test_macros(7) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2007-12-08 GETLOADAVG(3)
All times are GMT -4. The time now is 02:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy