
å°ãåã«ãææã®ãµã¼ã(èªåãã¡ã§ç®¡ç)ã§ãé常æã¯åé¡ãªãã®ã ãã©ãæã HTTPã¬ã¹ãã³ã¹ã§æ°ç§ãããç¾è±¡ãè¦åããããã®ã§ãåç¾ãããã¨ãã«ç®è¦ç¢ºèªã§ã²ãããHTTPãªã¯ã¨ã¹ããéãã¦ã¬ã¤ãã³ã·ã確èªã§ãããhttpingããå©ç¨ãã¾ããã
httpingã¯ãæè¬"ping"ã®HTTPçãHTTPãªã¯ã¨ã¹ãã§ãã¼ãªã³ã°ãã¦ãããã³ãã³ãã§ããICMPã¯åãä»ããªããã©HTTPã¯OKããããªãµã¼ãã«ãç£è¦ãªã©ã§ä½¿ãã¾ãã
ã¤ã³ã¹ãã¼ã«
Ubuntuã§ã¯ãaptã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ãããç°¡åã
$ sudo apt-get install httping
ããã ãã§ãã
ç°¡åãªä½¿ãæ¹
$ httping (URLã¾ãã¯IPã¢ãã¬ã¹)
ã§ãå®è¡å¯è½ã§ãã以ä¸ãå®è¡ä¾ã
$ httping http://xxx.xxx.xxx.xxx/ PING xxx.xxx.xxx.xxx:80 (http://xxx.xxx.xxx.xxx/): connected to xxx.xxx.xxx.xxx:80, seq=0 time=17.03 ms connected to xxx.xxx.xxx.xxx:80, seq=1 time=9.49 ms connected to xxx.xxx.xxx.xxx:80, seq=2 time=17.71 ms connected to xxx.xxx.xxx.xxx:80, seq=3 time=17.24 ms connected to xxx.xxx.xxx.xxx:80, seq=4 time=15.96 ms --- http://xxx.xxx.xxx.xxx/ ping statistics --- 5 connects, 5 ok, 0.00% failed round-trip min/avg/max = 9.5/15.5/17.7 ms
ç¹å®ã®URLã«å¯¾ãã¦ãHTTPã§ã®ãªã¯ã¨ã¹ã/ã¬ã¹ãã³ã¹ã®ç¢ºèªã¨ãªããå¿çæé(RTT)ã®æå°/å¹³å/æå¤§ããããã¾ãã
ã¡ãªã¿ã«ãããã©ã«ãã§å©ç¨ãããã®ã¯HEADãªã¯ã¨ã¹ãã§ãã(ã¬ã¹ãã³ã¹ã®ããã£ãå«ã¾ããªãã)
ãªãã·ã§ã³ãç¹ã«ä½ãä»ããªãã¨ãLinuxã§ã®pingã³ãã³ãåæ§ãå»¶ã
ã¨ãªã¯ã¨ã¹ããç¹°ãè¿ãã¾ãã
ã¬ã¹ãã³ã¹ããã£ã®éåä¿¡æéã確èªãããå ´å
以ä¸ã®ãããªæãã§å®è¡ãã¦ã¿ã¾ãã(ãã使ããªãã·ã§ã³ãè²ã ä»ãã¦ã¿ã¾ããã)
$ httping -c 5 -G -b -s -g http://yyy.xxx.com/img/xxx.jpg PING yyy.xxx.com:80 (http://yyy.xxx.com/img/xxx.jpg): connected to yyy.xxx.com:80, seq=0 time=1668.50 ms 200 OK 129KB/s connected to yyy.xxx.com:80, seq=1 time=1897.33 ms 200 OK 113KB/s connected to yyy.xxx.com:80, seq=2 time=2075.83 ms 200 OK 99KB/s connected to yyy.xxx.com:80, seq=3 time=2197.23 ms 200 OK 97KB/s connected to yyy.xxx.com:80, seq=4 time=1920.53 ms 200 OK 111KB/s --- http://yyy.xxx.com/img/xxx.jpg ping statistics --- 5 connects, 5 ok, 0.00% failed round-trip min/avg/max = 1668.5/1951.9/2197.2 ms Transfer speed: min/avg/max = 97/110/129 KB
ãã®ä¾ã§ã¯ãå°ããµã¤ãºã®ããç»åããªã¯ã¨ã¹ããã"-G"ãªãã·ã§ã³ãå©ç¨ãã¦GETãªã¯ã¨ã¹ããéãããã¡ã¤ã«ãã¼ã¿ã¨ãã£ãBODYèªä½ã®éåä¿¡æéãå«ãã§ãããããå¿çæéãâã®ä¾ãã大ãããªã£ã¦ãããã¨ã確èªã§ãããã¨æãã¾ãã
ã¡ãªã¿ã«"-c"ã¯åæ°ã®æå®ã"-G"ã¯GETãªã¯ã¨ã¹ãã®æå®ã"-b"ã¯ãã¼ã¿è»¢éé度ã®è¡¨ç¤º(KB/sec)ã"-s"ã¯ã¹ãã¼ã¿ã¹ã³ã¼ãã®è¡¨ç¤ºã"-g"ã¯ã¿ã¼ã²ããã¨ãªãURLãæå®ãããªãã·ã§ã³ã§ãã
å°ã"-b"ãªãã·ã§ã³ãä»ãã¦ããããã転ééåº¦ã®æå°/å¹³å/æå¤§å¤ã確èªã§ãã¾ãã
ãã®ä»ã®ãªãã·ã§ã³
ãåèã¾ã§ã«è¼ãã¦ããã¾ãã
ã¡ãªã¿ã«ãä»åâã§ç§ã使ã£ããã¼ã¸ã§ã³ã¯ã1.4.4ã§ããã
$ httping -V HTTPing v1.4.4, (C) 2003-2010 [email protected] SSL support included
SSLããµãã¼ããã¦ãã¾ããã(èªåã§ãã«ãããã¨ãã¯opensslãªã©ã®ã©ã¤ãã©ãªãå¿
è¦ãªã¯ãã)
ä»ã«ããã¤ã³ã¿ã¼ãã«ã®ãªãã·ã§ã³ã¯ãã使ãããâã®ãªãã·ã§ã³ä¸è¦§ãè¦ã¦ããã¨ãProxyã®è¨å®ããUserAgentããªãã¡ã©ã®å®ç¾©ãä½ããã£ã¦ãã¦OKã¨ããããªã©ã®å®ç¾©ãBASICèªè¨¼ã®å¯¾å¿ãCookieã®ä»å ãNagios modeãªãã¦ã®ãããã¾ããã
æ°ã«ãªãæ¹ã¯ãè²ã
試ãã¦ã¿ã¦ãã ããã
$ httping --help
-g url url (e.g. -g http://localhost/)
-h hostname hostname (e.g. localhost)
-p portnr portnumber (e.g. 80)
-x host:port hostname+portnumber of proxyserver
-c count how many times to connect
-i interval delay between each connect
-t timeout timeout (default: 30s)
-6 use IPv6
-s show statuscodes
-S split time in connect-time and processing time
-G do a GET request instead of HEAD (read the
contents of the page as well)
-b show transfer speed in KB/s (use with -G)
-B like -b but use compression if available
-L x limit the amount of data transferred (for -b)
to 'x' (in bytes)
-X show the number of KB transferred (for -b)
-l connect using SSL
-z show fingerprint (SSL)
-f flood connect (no delays)
-a audible ping
-m give machine parseable output (see
also -o and -e)
-o rc,rc,... what http results codes indicate 'ok'
coma seperated WITHOUT spaces inbetween
default is 200, use with -e
-e str string to display when http result code
doesn't match
-I str use 'str' for the UserAgent header
-R str use 'str' for the Referer header
-r resolve hostname only once (usefull when
pinging roundrobin DNS: also takes the first
DNS lookup out of the loop so that the first
measurement is also correct)
-n warn,crit Nagios-mode: return 1 when avg. response time
>= warn, 2 if >= crit, otherwhise return 0
-N x Nagios mode 2: return 0 when all fine, 'x'
when anything failes
-y ip[:port] bind to ip-address (and thus interface) [/port]
-q quiet, only returncode
-A Activate Basic authentication
-U Username needed for authentication
-P Password needed for authentication
-C cookie=value Add a cookie to the request
-V show the version
--url -g
--hostname -h
--port -p
--host-port -x
--count -c
--interval -i
--timeout -t
--ipv6 - 6
--show-statusodes -s
--split-time -S
--get-request -G
--show-transfer-speed -b
--show-xfer-speed-compressed -B
--data-limit -L
--show-kb -X
--use-ssl -l
--show-fingerprint -z
--flood -f
--audible-ping -a
--parseable-output -m
--ok-result-codes -o
--result-string -e
--user-agent -I
--referer -S
--resolve-once -r
--nagios-mode-1 -n
--nagios-mode-2 -n
--bind-to -y
--quiet -q
--basic-auth -A
--username -U
--password -P
--cookie -C
--version -V
--help -h

ã¦ã§ããªãã¬ã¼ã·ã§ã³ âãµã¤ãéç¨ç®¡çã®å®è·µãã¯ãã㯠(THEORY/IN/PRACTICE)
- ä½è : John Allspaw,Jesse Robbins,è§å¾å ¸
- åºç社/ã¡ã¼ã«ã¼: ãªã©ã¤ãªã¼ã¸ã£ãã³
- çºå£²æ¥: 2011/05/14
- ã¡ãã£ã¢: 大忬
- è³¼å ¥: 10人 ã¯ãªãã¯: 923å
- ãã®ååãå«ãããã° (50ä»¶) ãè¦ã