check website status, don't show 403 error

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.
Post Reply
aristosv
Posts: 12
Joined: Wed Apr 11, 2018 12:48 am

check website status, don't show 403 error

Post 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
corpshumming
Posts: 1
Joined: Tue Jul 18, 2023 11:03 pm
Location: United States
Contact:

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

Post by corpshumming »

The problem is that I can't make any modifications to the website since I lack the properdordle permissions.
kg2857
Posts: 234
Joined: Wed Apr 12, 2023 5:48 pm

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

Post 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..
samds
Posts: 1
Joined: Thu Oct 12, 2023 2:38 am

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

Post by samds »

try checking this again from DNS Checker
Post Reply