Sponsored Content
Full Discussion: PING broken check
Operating Systems Solaris PING broken check Post 302532653 by ygemici on Tuesday 21st of June 2011 03:00:50 PM
Old 06-21-2011
Quote:
Originally Posted by mjoshi87
Need to discuss a general query:

root@ggnems21 # ping -s ggnems23
PING ggnems23: 56 data bytes
64 bytes from ggnems23.aircel.co.in (172.18.124.38): icmp_seq=0. time=17.6 ms
64 bytes from ggnems23.aircel.co.in (172.18.124.38): icmp_seq=1. time=38.3 ms
64 bytes from ggnems23.aircel.co.in (172.18.124.38): icmp_seq=2. time=122. ms
64 bytes from ggnems23.aircel.co.in (172.18.124.38): icmp_seq=3. time=235. ms
64 bytes from ggnems23.aircel.co.in (172.18.124.38): icmp_seq=4. time=24.8 ms
^C
----ggnems23 PING Statistics----
5 packets transmitted, 5 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 17.6/87.5/235./92.


when is Ping Broken is valid ? i.e at what packet percentage i should comment it as PING BROKEN?

---------- Post updated at 01:10 AM ---------- Previous update was at 01:07 AM ----------

at what percentage packet loss?
If so then i would require this packet loss percetage to be included within my script


i try some script for your needs Smilie
Code:
# cat pinglist
localhost
localhost2
192.168.80.130

you can use this format "./testping.sh counts(packet try) hostlistfile"
and i defined some values in script like ; pingloss of percent(threshold value)=%50 ; send packet try waits=2..
but you change all settings if you think what about its..
for example
Code:
# ./testping.sh 1 pinglist
"localhost" is alive with "%0 of %100 loss rate" at 1 packet tries in 2 seconds intervals
 
ping: unknown host localhost2
ping failed while sending 'echo_request(s)' to "localhost2"
check!! host access (/network or firewall or route(ing) settings/) or
check!! resolution (/hosts/dns/nsswitch)!!
or
check!! be sure host is power up or
check!! is ping enabled in o.s or switch(s) or router(s)
 
ping failed while sending 'echo_request(s)' to "192.168.80.130"
check!! host access (/network or firewall or route(ing) settings/) or
check!! resolution (/hosts/dns/nsswitch)!!
or
check!! be sure host is power up or
check!! is ping enabled in o.s or switch(s) or router(s)

Code:
# cat testping.sh
## justdoit ## ping test on SUN OS ##
#!/usr/bin/bash
if [ $# != 2 ] ; then echo "usage $0 'packetcount' hostlistfile" ; exit 0 ; fi
sleep=2 ; c=$1 # count for packets
while read -r host ; do
(sleep $sleep;ping -s $host 56 $c >/dev/null) &
pid=$! ; wait $pid
if [ $? -eq 0 ] ; then
PL=$(i=1;while [ $i -le $c ] ; do sleep $sleep;ping -s $host 56 $c ;((i++));done)
echo "$PL"|nawk -F, -v c=$1 -v host=$host -v sleep=$sleep '/packets/{sub("% packet loss","",$3)}{t+=$3}
END{if(t>50*c){print "ping problem in \""host"\" !!\nping loss \"%"t" of %"100*c"\" for at "c" packet tries in "sleep" seconds intervals\n"}
else {print "\""host"\" is alive with \"%"t" of %"100*c" loss rate\" at "c" packet tries in "sleep" seconds intervals\n"}}'
else echo -e "ping failed while sending 'echo_request(s)' to \"$host\"\n\
check!! host access (/network or firewall or route(ing) settings/) or \ncheck!! resolution (/hosts/dns/nsswitch)!!\n\
or \ncheck!! be sure host is power up or \ncheck!! is ping enabled in o.s or switch(s) or router(s)\n"
fi;done<$2

regards
ygemici
This User Gave Thanks to ygemici For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Broken

Ok i am running Linux, or rather was. I can not longer do anything. This was a dns server amoungst other things. It will no longer boot. I have used a startup disk, but how can i recover the OS? I need help and urgently. Please someone thanks (3 Replies)
Discussion started by: ollyparkhouse
3 Replies

2. Debian

./configure is broken - /lib/cpp fails sanity check

Hi, I first wanted to install my NIC drivers but it said: Makefile:62: *** Linux kernel source not found. Stop. So I installed the kernel source: linux-source-2.6.18_2.6.18.dfsg.1-13etch5_all.deb 1) cd /usr/src 2) -xjvf linux-source.2.6.18.extension (forget what it was) 3) ln -s... (12 Replies)
Discussion started by: Virtuality
12 Replies

3. Solaris

How to check disk broken

Dear all, I have system that have 2 disk, and 1 off disk is broken, how can I check if the disk is broken or other problem. I'm using Solaris 10 x86. Thank you, Best Regards, Heru (4 Replies)
Discussion started by: heru_90
4 Replies

4. UNIX for Dummies Questions & Answers

ping is blocked hwo to check connection

Hi How to check connection with another IP/Server not using ping? Thanks (5 Replies)
Discussion started by: miojamo
5 Replies

5. Shell Programming and Scripting

[ASK] How to check whether ipv4 or ipv6 and ping those IP

I have perl script that I use to check and ping a list of ip, The problem is, I didnt understand how to ping ipv6 on perl, Could I use Ping::External??And how could I get the ping result (reply or not)? This is my code #!/usr/bin/perl -- use Net::Ping; use Data::Validate::IP; use... (3 Replies)
Discussion started by: franzramadhan
3 Replies

6. Shell Programming and Scripting

Animation Ping on Solaris Like Cisco Ping

Hi, I develop simple animation ping script on Solaris Platform. It is like Cisco ping. Examples and source code are below. bash-3.00$ gokcell 152.155.180.8 30 Sending 30 Ping Packets to 152.155.180.8 !!!!!!!!!!!!!.!!!!!!!!!!!!!!!. % 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies

7. Linux

Ping check failed from Nagios master server on windows hosts in the same subnet

Hello All, We have added a windows host and its config files to Nagios master server and wanted to do a ping check alone at the moment however, the nagios master server identifies the host in its GUI and immediately disappears can anyone let me know the right approach to this one, We want to... (2 Replies)
Discussion started by: lovesaikrishna
2 Replies

8. Shell Programming and Scripting

How to get reason for ping failure using perls Net::Ping->new("icmp");?

Hi I am using perl to ping a list of nodes - with script below : $p = Net::Ping->new("icmp"); if ($p->ping($host,1)){ print "$host is alive.\n"; } else { print "$host is unreacheable.\n"; } $p->close();... (4 Replies)
Discussion started by: tavanagh
4 Replies

9. Programming

Ping test sends mail when ping fails

help with bash script! im am working on this script to make sure my server will stay online, so i made this script.. HOSTS="192.168.138.155" COUNT=4 pingtest(){ for myhost in "$@" do ping -c "$COUNT" "$myhost" &&return 1 done return 0 } if pingtest $HOSTS #100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy