Sponsored Content
Full Discussion: Distribution of load
Top Forums Shell Programming and Scripting Distribution of load Post 302849917 by RudiC on Tuesday 3rd of September 2013 03:25:54 PM
Old 09-03-2013
This might serve as a starting point
Code:
awk     '                       {T[$1]=$3=="OverLoad"?-$5:$5}
         END{for (i in T)       {print i, T[i]}}
        ' file |
sort -n -k2 |
awk     '                       {T[NR]=$2
                                 S[NR]=$1
                                }
         END                    {D=NR; U=1
                                 while (T[U] < 0) {
                                   if (T[D] + T[U] >= 0) {print S[U] "->" S[D] ": " (-T[U]); T[D]+=T[U]; T[U++]=0}
                                   if (T[D] + T[U] <  0) {print S[U] "->" S[D] ": " ( T[D]); T[U]+=T[D]; T[D--]=0}
                                  }
                                }
        '
Server2->Server3: 431
Server1->Server3: 119
Server1->Server5: 133
Server6->Server5: 10

As my mawk does not have a builtin sort function, I had to fallback to the external sort. You can do this in one script if your awk provides a sort.
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

could not load hme

After installing Solaris patches, i faced this problem which the system could not load hme ( network interface). after booting up the system i try to configure the IP add. on hme (ifconfig hme inet ......),but it fails. the /etc/hostname.hme0 file exists & is ok & in Prom mode also after running... (1 Reply)
Discussion started by: nikk
1 Replies

2. UNIX for Dummies Questions & Answers

Load error

hi i am facing a problem when i run a shell script to load a table.the error is Record 1: Rejected - Error on table TRENDS."SHP_CUST_ORD_ITM". ORA-14400: inserted partition key is beyond highest legal partition key Record 2: Rejected - Error on table TRENDS."SHP_CUST_ORD_ITM", column... (4 Replies)
Discussion started by: musavir19
4 Replies

3. UNIX for Dummies Questions & Answers

load Balance

Guys im trying to create a script that will load ballance 3 devices. Unix is still very alien to me having only been in this position for 3 months now. Not to mention the fact that i've been thrown in the deep end. Anyway so far i've managed to make a script that looks at all 4 devices and make a... (1 Reply)
Discussion started by: yorkyboy
1 Replies

4. 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

5. UNIX for Dummies Questions & Answers

VPS has load 200, httpd load no activity, netstat nothing

Hello, on my hostserver i see one VPS of mine got load of 200.00 and netstat nothing (not a single blank line on netstat command) after some time, netstat started showing connections, but i see no excessive IP connections. tail -f /var/log/httpd/access_log shows no activity /var/log/messages ;... (1 Reply)
Discussion started by: postcd
1 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. Please notice this option isn't related to the terminal length as in a "80 culums terminal". --font=desc Set the font description. Default is Monospace 12. --rtl Do right to left (RTL) layout. --paper ps Choose paper size. Known paper sizes are legal, letter and A4. Default is A4. Postscript points Each postscript point equals to 1/72 of an inch. 36 points are 1/2 of an inch. --bottom-margin=bm Set bottom margin. Default is 36 postscript points. --top-margin=tm Set top margin. Default is 36 postscript points. --left-margin=lm Set left margin. Default is 36 postscript points. --right-margin=rm Set right margin. Default is 36 postscript points. --gutter-width=gw Set gutter width. Default is 40 postscript points. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 12:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy