URL Status Code

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

URL Status Code

Post by btayl »

I have User that want us to monitor URL for a Status Code 500 not sure how to do this.
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: URL Status Code

Post by btayl »

I meant to say only to 500-level errors
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: URL Status Code

Post by gsmith »

Hi

There's a few ways you could go here, so please answer the following:
1. Do you have access to the webserver(s)?
a. how many webservers are there?
b. what is the Operating System of the webserver(s)?

2. If you don't have access to the webserver(s) we can try using client (browser)

3. Do you want all the 4XX errors? all the 5XX errors? both?

Thanks
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: URL Status Code

Post by btayl »

2 web servers only 5XX errors?
Linux servers but do not have access to the os
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: URL Status Code

Post by gsmith »

Hi

Go to Configure, Core Config Mananger and create a new service, and set it up as:
Image7.jpg
where $ARG1$ is:
http://www.wa4e.com --invert-regex -r "500 Internal Server Error" -f ok -I 104.21.90.164 -S --sni -p 443

replace http://www.wa4e.com with the website you want to check
replace 104.21.90.164 with the IP of the website you want to check

and $ARG2$ is the URI

You will need to create 10 more of these commands, replacing "500 Internal Server Error" with:
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
510 Not Extended
511 Network Authentication Required

to see full details of the check_http plugin please see https://nagios-plugins.org/doc/man/check_http.html

Thanks
You do not have the required permissions to view the files attached to this post.
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: URL Status Code

Post by btayl »

Thanks for the Help
would this work as well ?

check_http -H httpstat.us -f ok -I 104.21.25.187 -u '/503' -p 80 --invert-regex -r "5.."

since we can use wild cards in regex
btayl
Posts: 131
Joined: Mon Aug 24, 2020 8:51 am

Re: URL Status Code

Post by btayl »

Is their a way not to show warnings ? because even if I d it the way you showed if I have like a error code 404 it shows a warning ?
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: URL Status Code

Post by gsmith »

Hi

check_http -H httpstat.us -f ok -I 104.21.25.187 -u '/503' -p 80 --invert-regex -r "5.." would only work if
the URL was https://webserver.com/503. So if the error page for a 503 error shows up at that url you would
catch it but not any other 5XX errors because you are limiting the check by the uri
Is their a way not to show warnings ? because even if I d it the way you showed if I have like a error code 404 it shows a warning ?
Wow - didn't notice this....I wonder why it shows as a warning. I am going to have dive into the plugin and see why it
is reporting a warning, especially since we don't have -w or -c options in use. Will let you know once I find out

Thanks
Locked