#374 Add regex for header checks in check_http

release-1.4.15
open
nobody
5
2014-07-11
2012-01-04
Bryan Irvine
No

I needed to be able to look for a specific string within the header itself.

check_http v1.4.15 (nagios-plugins 1.4.15)
./check_http <ip removed> -d 'X-Organization: N'
HTTP OK: HTTP/1.0 200 OK - 371 bytes in 0.047 second response time |time=0.047279s;;;0.000000 size=371B;;;0

./check_http <ip removed> -d 'X-Organization: N1'
HTTP CRITICAL: HTTP/1.0 200 OK - header 'X-Organization: N1' not found on 'http://<ip removed>:80/' - 371 bytes in 0.049 second response time |time=0.049446s;;;0.000000 size=371B;;;0

Tested on 64-bit Oracle Enterprise Linux
Linux version 2.6.18-194.17.1.0.1.el5 (mockbuild@ca-build9.us.oracle.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Wed Sep 29 15:57:39 EDT 2010
Command line: ro root=LABEL=/

gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)

Discussion

  • Bryan Irvine
    Bryan Irvine
    2012-01-04

    unified diff of check_http to allow for regex on header contents

     
    Attachments
  • Bryan Irvine
    Bryan Irvine
    2012-01-04

    • milestone: --> release-1.4.15