Page 1 of 1
HTTP response 500 error monitoring
Posted: Thu Feb 01, 2018 12:05 pm
by progressive.nagiosXI
Hi team,
We were monitorig all website with check_http plugin provided by default in Nagios. but we are having trouble in this because the website was giving code 500 but in monitoring the plugin was giving output in OK.
Please suggest what to do.
Re: HTTP response 500 error monitoring
Posted: Thu Feb 01, 2018 2:41 pm
by npolovenko
Hello,
@progressive.nagiosXI . We need some more information to assist you. Can you run the check_http plugin with the appropriate command, and with
-v at the end, from the command line? Please show us the output as well the command you ran.
Re: HTTP response 500 error monitoring
Posted: Thu Feb 01, 2018 10:48 pm
by progressive.nagiosXI
We just required this plugin to monitor HTTP Code 500 as it give ok in that condition also. PFB outpot
{
[root@monitoring-nagiosxi libexec]# ./check_http -H
www.google.com -v
GET / HTTP/1.1
User-Agent: check_http/v2.2.1 (nagios-plugins 2.2.1)
Connection: close
Host:
www.google.com
Accept: */*
http://www.google.com:80/ is 544 characters
STATUS: HTTP/1.1 302 Found
**** HEADER ****
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Location:
http://www.google.com.ph/?gfe_rd=cr&dcr ... 8QfimrvwBw
Content-Length: 272
Date: Fri, 02 Feb 2018 03:46:29 GMT
Connection: close
**** CONTENT ****
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="
http://www.google.com.ph/?gfe_rd=cr&dcr ... w">here</A>.
</BODY></HTML>
HTTP OK: HTTP/1.1 302 Found - 544 bytes in 0.145 second response time |time=0.144734s;;;0.000000 size=544B;;;0
}
Here you can see 302 found so can we create and alert on code 500.
Re: HTTP response 500 error monitoring
Posted: Fri Feb 02, 2018 1:55 am
by tacolover101
progressive.nagiosXI wrote:We just required this plugin to monitor HTTP Code 500 as it give ok in that condition also. PFB outpot
{
[root@monitoring-nagiosxi libexec]# ./check_http -H
http://www.google.com -v
GET / HTTP/1.1
User-Agent: check_http/v2.2.1 (nagios-plugins 2.2.1)
Connection: close
Host:
http://www.google.com
Accept: */*
http://www.google.com:80/ is 544 characters
STATUS: HTTP/1.1 302 Found
**** HEADER ****
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Location:
http://www.google.com.ph/?gfe_rd=cr&dcr ... 8QfimrvwBw
Content-Length: 272
Date: Fri, 02 Feb 2018 03:46:29 GMT
Connection: close
**** CONTENT ****
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="
http://www.google.com.ph/?gfe_rd=cr&dcr ... w">here</A>.
</BODY></HTML>
HTTP OK: HTTP/1.1 302 Found - 544 bytes in 0.145 second response time |time=0.144734s;;;0.000000 size=544B;;;0
}
Here you can see 302 found so can we create and alert on code 500.
i believe you'll want to use the expect function built in with check_http to create a 500 as an OK
Code: Select all
-e, --expect=STRING
Comma-delimited list of strings, at least one of them is expected in
the first (status) line of the server response (default: HTTP/1.)
If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)
Re: HTTP response 500 error monitoring
Posted: Fri Feb 02, 2018 10:56 am
by kyang
Thanks for the help
@tacolover101!
progressive.nagiosXI, Let us know if that helps you!