jablonka.czprosek.czf

netmap

Subversion Repositories:
[/] [gen_onestat_ping] - Blame information for rev 84

 

Line No. Rev Author Line
11simandl#!/bin/sh
2 
3# (c)2003 by Jan Krupa (krupaj@mobilnews.cz)
4# http://www.mobilnews.cz/honza/
5 
627simandlPING_PATH="ping -I 10.33.12.4"
71simandl 
8for LINE in `cat $1`; do
9 ping_host=`echo -n $LINE | awk -F\; '{ printf "%s", $2 }'`;
10 
11 ping_lat=\;`$PING_PATH -c 1 -w 2 $ping_host | grep rtt | awk -F\ '{ printf "%s", $4 }' | awk -F\/ ' { printf "%s", $2 }'`;
12 if [ "$ping_lat" = ";" ]; then
13 ping_lat=\;`$PING_PATH -c 1 -w 2 $ping_host | grep rtt | awk -F\ '{ printf "%s", $4 }' | awk -F\/ ' { printf "%s", $2 }'`;
14 fi;
15 
16 if [ "$ping_lat" = ";" ]; then
17 echo $ping_host\;0\;0\;;
18 
19 else
20 echo $ping_host\;1$ping_lat\;;
21 fi;
22 
23done

Powered by WebSVN 2.2.1