<pre><code>$ /usr/lib/nagios/plugins/check_http -V      
check_http v2.1.1 (monitoring-plugins 2.1.1) 
</code></pre>

<p>If we check an Apache 2.2 server under Debian Wheezy, all is OK.</p>

<pre><code>$ /usr/lib/nagios/plugins/check_http -S -H $MYDOMAIN
HTTP OK: HTTP/1.1 200 OK - 2481 bytes in 0.582 second response time |time=0.582011s;;;0.000000 size=2481B;;;0
</code></pre>

<p>If we check an Apache 2.4 server under Debian Jessie, there is an odd bug.</p>

<pre><code>$ /usr/lib/nagios/plugins/check_http -S -H $MYDOMAIN                                      
HTTP OK: HTTP/1.1 200 OK - 2392 bytes in 7.530 second response time |time=7.529691s;;;0.000000 size=2392B;;;0 
$ /usr/bin/time curl https://$MYDOMAIN -k -o /dev/null -s       
0.00user 0.00system 0:00.28elapsed 2%CPU (0avgtext+0avgdata 8828maxresident)k
</code></pre>

<p>Why it took 7+s where curl took 0.28s?</p>

<p>The fact is check_http doesn't seems to speak the same HTTPS as curl. I traced Apache to see more informations.</p>

<pre><code>14:57:42 accept4(6, {sa_family=AF_INET6, sin6_port=htons(53216), inet_pton(AF_INET6, "::ffff:88.179.18.233", &sin6_addr), sin6_flowinfo
=0, sin6_scope_id=0}, [28], SOCK_CLOEXEC) = 29
14:57:42 read(29, 0x7f7ddd36b048, 8000) = -1 EAGAIN (Resource temporarily unavailable)
14:57:42 poll([{fd=29, events=POLLIN}], 1, 7000) = 0 (Timeout)
14:57:49 close(29)                      = 0
</code></pre>

<p>It took 7+s, because my Apache server has a Timeout of 7s. Apache seems to wait something from check_http, before timeout occurs. (You can set Apache timeout to 30s, check_http will take 30+s).</p>

<p>An here comes the really odd part.</p>

<pre><code>$ /usr/lib/nagios/plugins/check_http -S -H $MYDOMAIN -N                                 
HTTP OK: HTTP/1.1 200 OK - 256 bytes in 0.555 second response time |time=0.554783s;;;0.000000 size=256B;;;0 
</code></pre>

<p>With -N, all is OK.</p>

<p>Any ideas? I opened the issue here because I have only this odd bug with check_http, not with curl, wget, browsers…<br>
It may be related to Apache, but that's quite odd.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br><a href="https://github.com/monitoring-plugins/monitoring-plugins/issues/1358">Reply to this email on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFQl2frSjdKv5u2wcgJ1wMIRaXsY5YYzks5o29-sgaJpZM4GGgPm.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/monitoring-plugins/monitoring-plugins/issues/1358"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>