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.
HTTP response 500 error monitoring
-
progressive.nagiosXI
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: HTTP response 500 error monitoring
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
progressive.nagiosXI
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Re: HTTP response 500 error monitoring
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.
{
[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.
- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: HTTP response 500 error monitoring
i believe you'll want to use the expect function built in with check_http to create a 500 as an OKprogressive.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.
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)