HTTP check - how to include response codes for 4xx and 5xx

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
clab
Posts: 5
Joined: Wed Jun 08, 2016 4:05 pm

HTTP check - how to include response codes for 4xx and 5xx

Post by clab »

Hello,

I have HTTP check running and for the most part it does alert when there are issues with my site. However what i'm looking for is to include the HTTP error on email alerts that are sent out.

Currently if there are any response codes other than "200 OK" alerts are sent out with the following messaging:

CRITICAL - Socket timeout after 10 seconds

Once the check recovers I do get the response code for "200 OK":

HTTP OK: HTTP/1.1 200 OK - 74735 bytes in 0.796 second response time

My goal is to include problem error response codes in the email alert much how the recovery email alert includes the "200 OK" info.

Any help would be greatly appreciated!

Thanks,
Chris
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: HTTP check - how to include response codes for 4xx and 5

Post by tgriep »

The "CRITICAL - Socket timeout after 10 seconds" message you are receiving is that the server is not active at all and it cannot return any error codes so it returns that message.
If the Apache server is still active but the page it is checking, etc has an error, you will get that code in the email.

If this is not what you are looking for, can you provide more details?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked