Sponsored Content
Top Forums Shell Programming and Scripting Count time min/max/average for ping Post 302538181 by zorrox on Tuesday 12th of July 2011 03:49:55 AM
Old 07-12-2011
Count time min/max/average for ping

I am redirecting my ping output to a file. The sample output is like this:

Code:
64 bytes from xx.xx.xx.167: icmp_seq=4490 ttl=116 3.75 ms 2011Jul12- 15 40 16
64 bytes from xx.xx.xx.167: icmp_seq=4491 ttl=116 5.29 ms 2011Jul12- 15 40 17
64 bytes from xx.xx.xx.167: icmp_seq=4492 ttl=116 4.88 ms 2011Jul12- 15 40 18
64 bytes from xx.xx.xx.167: icmp_seq=4493 ttl=116 4.33 ms 2011Jul12- 15 40 19
64 bytes from xx.xx.xx.167: icmp_seq=4494 ttl=116 3.93 ms 2011Jul12- 15 40 20
64 bytes from xx.xx.xx.167: icmp_seq=4495 ttl=116 4.05 ms 2011Jul12- 15 40 21
64 bytes from xx.xx.xx.167: icmp_seq=4496 ttl=116 3.33 ms 2011Jul12- 15 40 22
64 bytes from xx.xx.xx.167: icmp_seq=4497 ttl=116 4.23 ms 2011Jul12- 15 40 23
64 bytes from xx.xx.xx.167: icmp_seq=4498 ttl=116 3.59 ms 2011Jul12- 15 40 24
64 bytes from xx.xx.xx.167: icmp_seq=4499 ttl=116 3.57 ms 2011Jul12- 15 40 25
64 bytes from xx.xx.xx.167: icmp_seq=4500 ttl=116 5.27 ms 2011Jul12- 15 40 26
64 bytes from xx.xx.xx.167: icmp_seq=4501 ttl=116 4.51 ms 2011Jul12- 15 40 27
64 bytes from xx.xx.xx.167: icmp_seq=4502 ttl=116 3.45 ms 2011Jul12- 15 40 28
64 bytes from xx.xx.xx.167: icmp_seq=4503 ttl=116 4.16 ms 2011Jul12- 15 40 29
64 bytes from xx.xx.xx.167: icmp_seq=4504 ttl=116 3.34 ms 2011Jul12- 15 40 30
64 bytes from xx.xx.xx.167: icmp_seq=4505 ttl=116 4.59 ms 2011Jul12- 15 40 31
64 bytes from xx.xx.xx.167: icmp_seq=4507 ttl=116 3.46 ms 2011Jul12- 15 40 33
64 bytes from xx.xx.xx.167: icmp_seq=4508 ttl=116 5.34 ms 2011Jul12- 15 40 34


The reply time (rtt) is the seventh field (e.g. 5.34 for the last line).
How can I use awk to produce minimum, maximum and average for the rtt from all lines in the file? How to do it without awk?

Last edited by radoulov; 07-12-2011 at 08:29 AM.. Reason: Code tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

min and max value of process id

We are running a AIX 5.2 OS. Would anyone happen to know what the max value for a process id could be? Thanks jerardfjay :) (0 Replies)
Discussion started by: jerardfjay
0 Replies

2. UNIX for Dummies Questions & Answers

Iterate a min/max awk script over time-series temperature data

I'm trying to iterate a UNIX awk script that returns min/max temperature data for each day from a monthly weather data file (01_weath.dat). The temperature data is held in $5. The temps are reported each minute so each day contains 1440 temperature enteries. The below code has gotten me as far as... (5 Replies)
Discussion started by: jgourley
5 Replies

3. Shell Programming and Scripting

get min, max and average value

hi! i have a file like the attachement. I'd like to get for each line the min, max and average values. (there is 255 values for each line) how can i get that ? i try this, is it right? BEGIN {FS = ","; OFS = ";";max=0;min=0;moy=0;total=0;freq=890} $0 !~ /Trace1:/ { ... (1 Reply)
Discussion started by: riderman
1 Replies

4. Shell Programming and Scripting

How to find the average,min,max ,total count?

Hi , Below is my sample data,I have this 8 column(A,B,C,D,E,F,G,H) in csv file. A , B ,C ,D ,E ,F,G ,H 4141,127337,24,15,20,69,72.0,-3 4141,128864,24,15,20,65,66.0,-1 4141,910053,24,15,4,4,5.0,-1 4141,910383,24,15,22,3,4.0,-1 4141,496969,24,15,14,6,-24.0,-18... (7 Replies)
Discussion started by: vinothsekark
7 Replies

5. Shell Programming and Scripting

Number of elements, average value, min & max from a list of numbers using awk

Hi all, I have a list of numbers. I need an awk command to find out the numbers of elements (number of numbers, sort to speak), the average value the min and max value. Reading the list only once, with awk. Any ideas? Thanks! (5 Replies)
Discussion started by: black_fender
5 Replies

6. Shell Programming and Scripting

Average, min and max in file with header, using awk

Hi, I have a file which looks like this: FID IID MISS_PHENO N_MISS N_GENO F_MISS 12AB43131 12AB43131 N 17774 906341 0.01961 65HJ87451 65HJ87451 N 10149 906341 0.0112 43JJ21345 43JJ21345 N 2826 906341 0.003118I would... (11 Replies)
Discussion started by: kayakj
11 Replies

7. Shell Programming and Scripting

Get min and max value in column

Gents, I have a big file file like this. 5100010002 5100010004 5100010006 5100010008 5100010010 5100010012 5102010002 5102010004 5102010006 5102010008 5102010010 5102010012 The file is sorted and I would like to find the min and max value, taking in the consideration key1... (3 Replies)
Discussion started by: jiam912
3 Replies

8. Shell Programming and Scripting

Find min and max time taken from a log file

You have a log file as attached in sample input with various operations and time taken by each of them. Write a script to find the min and max time taken for each operation. Sample output is attached. Sample Input is given as below: operation1,83621 operation2,72321 operation3,13288... (1 Reply)
Discussion started by: Chandan_Bose
1 Replies

9. UNIX for Beginners Questions & Answers

How to count average and max respon time?

sorry i will revise first (1 Reply)
Discussion started by: fajar_3t3
1 Replies

10. UNIX for Beginners Questions & Answers

How to count respon time max min avg for nginx logs?

Hi All, need your help, i want count respon time max and average my nginx logs, based on hourly or minutes per api... my nginx.log sample : 10.1.1.1 - - "POST /v2/api/find/outlet/ HTTP/1.1" 200 2667 "-" "okhttp/3.12.0" "118.215.153.47" 0.178 0.178 . 10.1.1.1 - - "POST... (4 Replies)
Discussion started by: fajar_3t3
4 Replies
OCF_PACEMAKER_PING(7)					      Pacemaker Configuration					     OCF_PACEMAKER_PING(7)

NAME
ocf_pacemaker_ping - node connectivity SYNOPSIS
[OCF_RESKEY_pidfile=string] [OCF_RESKEY_dampen=integer] [OCF_RESKEY_name=string] [OCF_RESKEY_multiplier=integer] [OCF_RESKEY_host_list=string] [OCF_RESKEY_attempts=integer] [OCF_RESKEY_timeout=integer] [OCF_RESKEY_options=string] [OCF_RESKEY_debug=string] ping [start | stop | reload | monitor | meta-data | validate-all] DESCRIPTION
Every time the monitor action is run, this resource agent records (in the CIB) the current number of ping nodes the host can connect to. It is essentially the same as pingd except that it uses the system ping tool to obtain the results. SUPPORTED PARAMETERS
OCF_RESKEY_pidfile = string [/var/run//ping-default] PID file OCF_RESKEY_dampen = integer [5s] Dampening interval The time to wait (dampening) further changes occur OCF_RESKEY_name = string [pingd] Attribute name The name of the attributes to set. This is the name to be used in the constraints. OCF_RESKEY_multiplier = integer [] Value multiplier The number by which to multiply the number of connected ping nodes by OCF_RESKEY_host_list = string [] Host list The list of ping nodes to count. Defaults to all configured ping nodes. Rarely needs to be specified. OCF_RESKEY_attempts = integer [2] no. of ping attempts Number of ping attempts, per host, before declaring it dead OCF_RESKEY_timeout = integer [2] ping timeout in seconds How long, in seconds, to wait before declaring a ping lost OCF_RESKEY_options = string [] Extra Options A catch all for any other options that need to be passed to ping. OCF_RESKEY_debug = string [false] Verbose logging Enables to use default attrd_updater verbose logging on every call. AUTHOR
Andrew Beekhof <andrew@beekhof.net> Author. Pacemaker Configuration 07/05/2010 OCF_PACEMAKER_PING(7)
All times are GMT -4. The time now is 03:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy