Nagios - HTTP WARNING: HTTP/1.1 403 Forbidden
I solved it by executing
$ touch /var/www/html/index.html
$ chmod 755 /var/www/html/index.html
on the remote server.
You can put a username/password and tell nagios what to expect via -e
. It is not a must to authorize in any case and it is also not critical to have a WARNING
.
/usr/local/nagios/libexec/check_http -H 128.19.5.131 -e 'HTTP' --authorization=username:password
Update:
The reason why you get forbidden
is because you don't have any index file and directory listing is disabled. You can create a file nagios.txt
(without putting anything in) and let nagios fetch that file instead of a directory which it is not allowed to view.
I created a file with name index.html
in the /var/www/html
directory of the remote Linux machine (128.19.5.131). Restarted the HTTP service with service httpd restart
and then executed the same command, i.e. :
nagiossrv root [libexec] >/usr/local/nagios/libexec/check_http -H 128.19.5.131
I got following output:
HTTP OK HTTP/1.1 200 OK - 250 bytes in 0.001 seconds |time=0.000977s;;;0.000000 size=250B;;;0
I do not know whether it is proper to add index.html
file in the /var/www/html
directory of each host to be monitored or not, but it is showing desired results in the Nagios XI console.