Page 1 of 1

Nagios not sending notification for URL

Posted: Wed Feb 06, 2019 1:39 am
by RIDS_I2MP
Hello Team,

We are monitoring a URL through Nagios, this URL opens up with a pop-up asking for login credentials.

http://10.144.223.76/

When we configured URL monitoring for this, it was throwing error with error code 401.
So, we have changed its definition by adding error code 401 as exception.

Command view: $USER1$/check_http -H $HOSTADDRESS$ $ARG1$ -t 30
$ARG1$: -f ok -I 10.144.223.76 -u '/' -p 80 -e 401

After making above changes, we were able to monitor the URL. We also tested it once by bringing down the URL manually for few mins and Nagios triggered alert for the same.

Yesterday, the URL went down as service was in hung state, but Nagios did not send any alert for it.

The URL was generating below error code:
"Request timed out waiting to execute" with error code 503.

The problem is, why Nagios did not capture that error and did not send the alert.

Kindly, look into this issue on priority and let us know what we are missing here.

Re: Nagios not sending notification for URL

Posted: Wed Feb 06, 2019 2:58 pm
by cdienger
Do you see any mention of this service's problem under Home > Monitoring Process > Event Log? If not, it's entirely possible that the check didn't actually fail for some reason(caching proxies, route, etc...) on the XI server as the check_http command should return CRITICAL for a 503 message. To verify I ran:

/usr/local/nagios/libexec/check_http -H httpstat.us -f ok -I 23.99.0.12 -u '/503' -p 80 -e 401 -v

Re: Nagios not sending notification for URL

Posted: Thu Feb 07, 2019 2:04 am
by RIDS_I2MP
Hello,

Thanks for the reply!!

Yes i can see log entry for that duration as below:

2019-02-04 12:27:29HOST ALERT: 10.144.223.76;UP;SOFT;3;HTTP WARNING: HTTP/1.1 401 Unauthorized - 1915 bytes in 2.911 second response time
Host Down2019-02-04 12:26:42HOST ALERT: 10.144.223.76;DOWN;SOFT;2;CRITICAL - Socket timeout after 10 seconds
Host Down2019-02-04 12:25:54HOST ALERT: 10.144.223.76;DOWN;SOFT;1;CRITICAL - Socket timeout after 10 seconds


Actually, the service running on the host went into hung state for some time and this URL was not accessible for that duration.
The URL took time to show the error code, I mean, it was loading for some time and then it threw the error code 503.

We can see that Nagios captured "Socket timeout after 10 seconds" error, but the question is why we did not receive alert for that error as well.

Please let us know how we can get alerts.

Re: Nagios not sending notification for URL

Posted: Thu Feb 07, 2019 1:06 pm
by cdienger
The timeout messages occur twice and are both in SOFT states. Notifications are not sent for SOFT states and it looks like the service came back up before it could reach a HARD state.

If you would like to see notifications sent earlier then you'll need to lower the value for the max reties on the service. This will allow the status to go into a HARD state quicker which then triggers a notification.

Re: Nagios not sending notification for URL

Posted: Fri Feb 08, 2019 12:56 am
by RIDS_I2MP
Hello,

Thank you so much for explaining the scenario.

We are good with it now, we can close the topic :)

Re: Nagios not sending notification for URL

Posted: Fri Feb 08, 2019 8:29 am
by scottwilkerson
RIDS_I2MP wrote:Hello,

Thank you so much for explaining the scenario.

We are good with it now, we can close the topic :)
Great!

Locking thread