Ping для HTTP

Иногда полезно узнать время отклика какого-нибудь веб-сервиса. Есть небольшая утилитка httping, которая позволяет это делать. Устанавливаем:

sudo emerge -av net-analyzer/httping

Пробуем пинговать какой-нибудь веб-сервис. Под катом…

$ httping oioki.ru
PING oioki.ru:80 (oioki.ru):
connected to 176.9.147.148:80 (270 bytes), seq=0 time=180.74 ms 
connected to 176.9.147.148:80 (270 bytes), seq=1 time=194.30 ms 
connected to 176.9.147.148:80 (270 bytes), seq=2 time=184.01 ms 
connected to 176.9.147.148:80 (270 bytes), seq=3 time=180.98 ms 
connected to 176.9.147.148:80 (270 bytes), seq=4 time=177.99 ms 
connected to 176.9.147.148:80 (270 bytes), seq=5 time=178.99 ms 
connected to 176.9.147.148:80 (270 bytes), seq=6 time=180.64 ms 
connected to 176.9.147.148:80 (270 bytes), seq=7 time=182.84 ms 
connected to 176.9.147.148:80 (270 bytes), seq=8 time=181.90 ms 
connected to 176.9.147.148:80 (270 bytes), seq=9 time=183.28 ms 
^CGot signal 2
--- oioki.ru ping statistics ---
10 connects, 10 ok, 0.00% failed, time 11182ms
round-trip min/avg/max = 178.0/182.6/194.3 ms

Конечно, можно пинговать и другие сервисы, например, SSH, но в этом случае таймаутов вы не увидите:

$ httping remote-server -p 22 -t 1
error receiving reply from host
error receiving reply from host
error receiving reply from host
error receiving reply from host
^CGot signal 2
--- remote-server ping statistics ---
4 connects, 0 ok, 100.00% failed, time 5969ms

Однако по сообщению “error receiving reply from host” можно понять, что порт всё-таки открыт. Если порт будет закрыт, то этого сообщения не будет.

One thought on “Ping для HTTP”

Leave a Reply

Your email address will not be published. Required fields are marked *