пятница, 18 марта 2011 г.

Normal ping in Solaris

I always disliked default behavior of Solaris ping:

me@host$ ping example.org
example.org is alive

Luckily, ping has "-s" parameter.

me@host$ ping -s example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.214 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.317 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.222 ms
64 bytes from example.org (192.168.1.1): icmp_seq=3. time=0.202 ms
^C
----example.org PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.202/0.239/0.317/0.053


Less known feature is MACHINE_THAT_GOES_PING environment variable, available at least in all recent OpenSolaris versions and derivatives. When it set, '-s' key is set by default.

me@host$ export MACHINE_THAT_GOES_PING=1
me@host$ ping example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.193 ms
^C
----example.org PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.193/0.210/0.218/0.014


Now I'm going to add this variable to my .profile :)

Комментариев нет:

Отправить комментарий