Problem with check_http

Julio Pedreira Paz <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Message-ID <C63BD74C83B6364E8949F4D4752127F77CEAA110@ATLEISEXCMBX2.eis.equifax.com>
Hi,

I have realized that in check_http, when -C option is used ("Minimum number of days a certificate has to be valid"), other checks doesn't take effect. This is not documented, nor checked as an options error, so it seem a strange behaviour to me. An example:

check_http -I 172.22.192.20 -H server1 -p 443 -S -e "HTTP/1.1 201 "
HTTP CRITICAL - Invalid HTTP response received from host on port 443: HTTP/1.1 200 OK
check_http -I 172.22.192.20 -H server1 -p 443 -S -e "HTTP/1.1 201 " -C 100
OK - Certificate will expire on 05/09/2016 12:00.

Tracking it to the code (check_http):

/* try to connect to the host at the given port number */
if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK)
die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n"));
#ifdef HAVE_SSL
if (use_ssl == TRUE) {
np_net_ssl_init_with_hostname(sd, (use_sni ? host_name : NULL));
if (check_cert == TRUE) {
result = np_net_ssl_check_cert(days_till_exp);
np_net_ssl_cleanup();
if (sd) close(sd);
return result;
}
  }
#endif /* HAVE_SSL */

Is this the expected behaviour?


Saludos,

J.


Julio Pedreira Paz
Enterprise Architect - IT Architecture & Design
Equifax Ibérica
Fijo/Land:  +34 91 768 773  (7732)
Móvil/Cell: +34 626 721 620  (8732)
[email protected]<mailto:[email protected]>
www.equifax.es<http://www.equifax.es/>

Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción. Esta mensagem destina-se exclusivamente ao destinatário e pode conter informação privilegiada e/ou confidencial. Se não é o destinatário da mensagem, fique ciente que a utilização, divulgação e/ou cópia sem autorização, está proibida pela lei actualmente em vigor. Se recebeu esta mensagem por engano, pedimos-lhe que no-lo comunique imediatamente por esta mesma via, e proceda à destruição da mesma

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk

_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.