Page 1 of 1

check website status, don't show 403 error

Posted: Thu Dec 15, 2022 8:33 am
by aristosv
I am using the host definition below to monitor if a website is up. Nagios shows me that the website is up but also reports this warning.

Code: Select all

HTTP WARNING: HTTP/1.1 403 Forbidden - 395 bytes in 0.008 second response time 

Code: Select all

define host {
    host_name              hostnamehere.com
    alias                  hostname
    address                hostnamehere.com
    max_check_attempts     2
    check_period           24x7
    check_interval         0.5
    check_command          check_http
    contacts               contact_group_here
    notification_interval  0
    notification_period    24x7
}
I read that to resolve the issue I need to create an index.html in the root directory of the web server, or change the webserver configuration.

The issue is that I don't have access to make changes on the web server.

Is there a way to configure Nagios not to report the 403 warning if the website is up and doesn't have an index.html file in it's root directory?

Thanks

Re: check website status, don't show 403 error

Posted: Tue Jul 18, 2023 11:05 pm
by corpshumming
The problem is that I can't make any modifications to the website since I lack the properdordle permissions.

Re: check website status, don't show 403 error

Posted: Thu Jul 20, 2023 11:35 pm
by kg2857
I wouldn't use
address hostnamehere.com
since that requires hitting DNS for each check. Then again, you might want to do so and that's another issue. I use the IP as host address, which could be good or less so.
Anyway, look at check_http -h for the regexp options to make the plugin do what you want..

Re: check website status, don't show 403 error

Posted: Thu Oct 12, 2023 2:43 am
by samds
try checking this again from DNS Checker