Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
This plugin tests the HTTP service on the specified host. It can test normal (HTTP) and secure (HTTPS) servers, follow redirects, search for strings and regular expressions, check connection times, and report on certificate expiration times.

Status
colourGreen
titleLAST TESTED ON CHECKMK 2.23.0P1


Panel
borderColorblack
bgColor#f8f8f8
titleTable of Contents

Table of Contents

...

There are several ways to access the command. One way is described here: Configuring Check Email (check_mail)#ExecuteactiveCheckmanually

One other way is with cmk -N:

...

Code Block
languagebash
themeRDark
OMD[mysite]:~/lib/nagios/plugins$ ./check_http '-u' 'https://www.google.com/' '--ssl' '--onredirect=follow' '-j' 'CONNECT' '--sni' '-p' 'proxy_port' 'myproxyip' 'www.google.com'


For a detailed log, you can use --verbose at the end of the command:

Code Block
languagebash
themeRDark
OMD[mysite]:~/lib/nagios/plugins$ ./check_http '-u' 'https://www.google.com/' '--ssl' '--onredirect=follow' '-j' 'CONNECT' '--sni' '-p' 'proxy_port' 'myproxyip' 'www.google.com' --verbose


For more information, you can use --help command flag.

Code Block
languagebash
themeRDark
OMD[mysite]:~/lib/nagios/plugins$ ./check_http --help

...

In the following example, we are using regular expressions on status.cloud.google.com to gather Access Content Manager information. 

Example Check HTTP serviceImage Modified


The service check returns OK

Screenshot of HTTP check OKImage Modified


Running the command by hand can help debug issues as well.

...

  • Address (name / IP or Proxy)  → If you need a proxy to access the domain
  • Virtual host → is necessary if you have multiple domains and one host running
  • How to handle redirect → How to handle redirected pages
  • Regular Expression to expect in content → Used to parse particular content from websites. 
  • HTTP Method → Set to CONNECT if you're using a proxy


    Example configuration of Check HTTP service.Image Modified


Info

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "check_http" , "http" , "active_check" ) and type = "page" and space = "KB"
labelshttp check_http

...