1755382 Members
3895 Online
54828 Solutions
New Discussion юеВ

changing ping interval

 
SOLVED
Go to solution
Shivkumar
Super Advisor

changing ping interval

When pinging to the servers sometimes i get request timed out response due to slow response of the network. I want to increase the defualt ping interval.

Can someone let me know how to ping to the boxes by changing default time interval ?

Thanks,
Shiv
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: changing ping interval

Hi Shiv:

# ping anyhost -m 25

...changes the default 10-second timeout to 25-seconds

With all respect, the manpages are one of your best friends:

# man 1M ping

...and if you didn't know too look in section 1M you could learn that via:

# whereis ping

...which would return:

ping: /usr/sbin/ping /usr/share/man/man1m.Z/ping.1m

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor
Solution

Re: changing ping interval

Hi (again) Shiv:

I should have added that if you change the default timeout value (-m) then you MUST specify the '-n' count too. Of course, the manpages document that :-))

# ping servername -n 1 -m 25

...issues one (-n 1) packet and sets the timeout to 25-seconds (-m).

There is also a '-I interval' which sets the number of seconds between packets. It defaults to one. If you thus wanted to ping a server 5-times with 3-seconds between each ping, you would do:

# ping -I 3 servername -n 5

Perhaps this is the "interval" you meant.

Regards!

...JRF...
Mahesh Kumar Malik
Honored Contributor

Re: changing ping interval

Hi Shiv

#ping -t is the preferred option when you need to ping for longer intervals. Following link may be of help

http://docs.hp.com/en/B2355-90692/ping.1M.html

Regards
Mahesh
Yogeeraj_1
Honored Contributor

Re: changing ping interval

hi shiv,

note that with ping, the -m timeout overrides the default timeout value (10 seconds) which ping uses to timeout (in seconds) when a host or network is unreachable. This option is valid only with the -n option or when count is specified. The -m option should not be used with count equal to 0.

The -m option is not effective for reachable hosts or networks.

(extract from man ping)

# ping
Usage: ping [-oprv] [-I interval] host [-n count [-m timeout]]
ping [-oprv] [-I interval] host packet-size [[-n] count [-m timeout]]


regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Raj D.
Honored Contributor

Re: changing ping interval

Hi shiv ,

You can try with -n option for number of ping requests.

# ping hostname -n 5 [ Will ping 5 times ]


In hp-ux B.11.00 the -m option is not there. And gives error.

#ping host05 -n 1 -m 10
Usage: ping [-oprv] [-i address] [-t ttl] host [-n count]
ping [-oprv] [-i address] [-t ttl] host packet-size [[-n] count]
----------------------------------------

Where as hp-ux 11i having -m option.

Usage: ping [-oprv] [-I interval] host [-n count [-m timeout]]
ping [-oprv] [-I interval] host packet-size [[-n] count [-m timeout]]
----------------------------------------

Cheers,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "