[rrd-users] Re: QOS Help

Serge Maandag serge.maandag at staff.zeelandnet.nl
Thu Jan 15 10:14:08 MET 2004


Hmm,

that's not too difficult.
define a hash, loop the list, grab the values ( /(\S+)\s+(\S+)/ ), add
$2 to $hash{$1} and you'll have your 2 values waiting in the hash.

Here's an awk example that does the same. Sort your lines and pipe them
to this command:
awk  's==/^$/{l=$1;s=0}$1!=l{printf "%s %.0f\n",l,s;l=$1;s=0}$1==l{s +=
$2}END{printf "%s %.0f\n", l,s}'

Serge.

-----Original Message-----
From: Cassie Bezuidenhout [mailto:cassieb at ifusion.co.za] 
Subject: [rrd-users] Re: QOS Help

I manage to get all the right values but my results looks something like
this...

$Value1			$Value2
jhbfdx1interlocq 		3752568281
jhbfdx1interlocq 		3752042674
jhbfdx1interlocq 		1901157205
jhbfdx1interlocq 		1899725097
jhbvolinterlocq 		1586152685
jhbvolinterlocq 		1583119059
jhbvolinterlocq 		2706518142
jhbvolinterlocq 		2706787396

I need to add the second values up when the first values are the same to
pass onto my RRD. Any idea how to do this with perl

-------------
Op de inhoud van dit e-mailbericht en de daaraan gehechte bijlagen is de inhoud van de volgende disclaimer van toepassing: http://www.zeelandnet.nl/disclaimer.php

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list