check_http - ssl no signed certificate - string search
Posted: Wed Dec 18, 2019 1:38 pm
I need to monitor a https web site and look for a string. I'm trying to use check_http. This server does not have a signed cert.
If I only check for the page load it succeeds.
/usr/local/nagios/libexec/check_http -H 3.1.1.1 -f ok -I 3.1.1.1 -u "/provisioning" -S --sni -p 8443
HTTP OK: HTTP/1.1 302 Moved Temporarily - 175 bytes in 0.015 second response time |time=0.014650s;;;0.000000 size=175B;;;0
If I check for a string I get string not found.
/usr/local/nagios/libexec/check_http -H 3.1.1.1 -f ok -I 3.1.1.1 -u "/provisioning" -S --sni -p 8443 -s 'Accelerator'
HTTP CRITICAL: HTTP/1.1 302 Moved Temporarily - string 'Accelerator' not found on 'https://3.1.1.1:8443/provisioning' - 175 bytes in 0.015 second response time |time=0.014747s;;;0.000000 size=175B;;;0
If I check with a regex I get pattern not found.
/usr/local/nagios/libexec/check_http -H 3.1.1.1 -f ok -I 3.1.1.1 -u "/provisioning" -S --sni -p 8443 -Rl '.*Accelerator.*'
HTTP CRITICAL: HTTP/1.1 302 Moved Temporarily - pattern not found - 175 bytes in 0.015 second response time |time=0.014739s;;;0.000000 size=175B;;;0
I don't see an option to dump the page output the check is using. If there was an option I could verify what check_http collects and I see if it's what's expected.
The server is running https on alternative port. There isn't a signed certificate so you get the warning when using a browser. I used developer tools to verify the string is in the output.
Can you help me configure the check correctly?
If I only check for the page load it succeeds.
/usr/local/nagios/libexec/check_http -H 3.1.1.1 -f ok -I 3.1.1.1 -u "/provisioning" -S --sni -p 8443
HTTP OK: HTTP/1.1 302 Moved Temporarily - 175 bytes in 0.015 second response time |time=0.014650s;;;0.000000 size=175B;;;0
If I check for a string I get string not found.
/usr/local/nagios/libexec/check_http -H 3.1.1.1 -f ok -I 3.1.1.1 -u "/provisioning" -S --sni -p 8443 -s 'Accelerator'
HTTP CRITICAL: HTTP/1.1 302 Moved Temporarily - string 'Accelerator' not found on 'https://3.1.1.1:8443/provisioning' - 175 bytes in 0.015 second response time |time=0.014747s;;;0.000000 size=175B;;;0
If I check with a regex I get pattern not found.
/usr/local/nagios/libexec/check_http -H 3.1.1.1 -f ok -I 3.1.1.1 -u "/provisioning" -S --sni -p 8443 -Rl '.*Accelerator.*'
HTTP CRITICAL: HTTP/1.1 302 Moved Temporarily - pattern not found - 175 bytes in 0.015 second response time |time=0.014739s;;;0.000000 size=175B;;;0
I don't see an option to dump the page output the check is using. If there was an option I could verify what check_http collects and I see if it's what's expected.
The server is running https on alternative port. There isn't a signed certificate so you get the warning when using a browser. I used developer tools to verify the string is in the output.
Can you help me configure the check correctly?