URL monitoring with execultion for a range of value

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

URL monitoring with execultion for a range of value

Post by naranant »

Hello,

I have the requirement to monitor the URL with the authentication and need to ignore the alerts for the range from 2XX to 3XX. Need help in defining the same. Currently, i could define for only one range i.e. 200. Below is command line i have used.


Check_xi_service_http! -f ok -I xxx.xx.xxx.xxx -u '/' -S -p 443 -a 'xxxxxx:xxxxx' --expect=200!!!!!!!

Below is the output

HTTP CRITICAL - Invalid HTTP response received from host on port 443: HTTP/1.1 302 Found
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: URL monitoring with execultion for a range of value

Post by mcapra »

I'd imagine the list of valid response codes is short enough that one could hard-code them:

Code: Select all

/usr/local/nagios/libexec/check_http -H www.google.com -j HEAD --expect=200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308
This would effectively return a CRITICAL for any 4xx/5xx codes unless the HTTP server is returning some crazy custom response codes. For a more elegant solution, I think check_http would need to be altered. Feel free to submit a GitHub issue to see that happen:
https://github.com/nagios-plugins/nagios-plugins
Former Nagios employee
https://www.mcapra.com/
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: URL monitoring with execultion for a range of value

Post by npolovenko »

Thanks, @mcapra.
@naranant, Let us know if you have any other questions for us.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: URL monitoring with execultion for a range of value

Post by naranant »

Thanks, @mcapra.

It worked...
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: URL monitoring with execultion for a range of value

Post by tmcdonald »

Glad to hear it! I'll be closing this thread now, but feel free to open another if you need anything in the future.
Former Nagios employee
Locked