Error w/ localhost - HTTP WARNING: HTTP/1.1 403 Forbidden
Posted: Thu Jan 11, 2018 5:24 pm
Hello:
Using Oracle Enterprise Linux 7.3, latest install of Nagios XI installed (ver. 5.4.11).
First thing I see in the web console is localhost doing a check_http and getting error:
HTTP WARNING: HTTP/1.1 403 Forbidden
I did some checking around and found the following, but they didn't help fix the warning/issue:
1). http://raman-kumar.blogspot.com/2009/12 ... 1-403.html
2). https://serverfault.com/questions/52934 ... 60-seconds
3). https://support.nagios.com/forum/viewto ... en#p201859
4). https://serverfault.com/questions/52183 ... nux/521834
I did some digging around and found that localhost uses:
/usr/local/Nagios/etc/services/localhost.cfg
which has:
define service {
host_name localhost
service_description HTTP
use local-service
check_command check_http
SSH'ed into the new Nagios XI server as root and then ran the following from the command line and result is as follows:
a). /usr/local/nagios/libexec/check_http -H <new_nagiosxi_server_IP>
Result: HTTP WARNING: HTTP/1.1 403 Forbidden
b). /usr/local/nagios/libexec/check_http -H <new_nagiosxi_server_IP> -u "/nagiosxi"
Result: HTTP OK: HTTP/1.1 301 Moved Permanently
c). /usr/local/nagios/libexec/check_http -H <any_website, ex. google.com or internal website we host>
Result: HTTP OK: HTTP/1.1 301 Moved Permanently
SOLUTION: "Re-engineered" NagiosXI localhost check_http temporarily until a possible better "fix" is identified.
1). Stopped Apache and NagiosXI on server
2). Edited the "/usr/local/nagios/etc/services/localhost.cfg" file:
a). Changed the following:
define service {
commented out: use local-service
added: use xiwizard_website_http_service
added: contacts nagiosadmin
commented out: check_command check_http
added: check_command check_xi_service_http! -f ok -I <new_nagiosxi_server_IP> -u '/nagiosxi' -p 80
Either I leave this, or wait for a solution from Nagios XI tech team, or delete the localhost check, since if I can connect/access the Nagios XI web console, then Apache is working at least.
Using Oracle Enterprise Linux 7.3, latest install of Nagios XI installed (ver. 5.4.11).
First thing I see in the web console is localhost doing a check_http and getting error:
HTTP WARNING: HTTP/1.1 403 Forbidden
I did some checking around and found the following, but they didn't help fix the warning/issue:
1). http://raman-kumar.blogspot.com/2009/12 ... 1-403.html
2). https://serverfault.com/questions/52934 ... 60-seconds
3). https://support.nagios.com/forum/viewto ... en#p201859
4). https://serverfault.com/questions/52183 ... nux/521834
I did some digging around and found that localhost uses:
/usr/local/Nagios/etc/services/localhost.cfg
which has:
define service {
host_name localhost
service_description HTTP
use local-service
check_command check_http
SSH'ed into the new Nagios XI server as root and then ran the following from the command line and result is as follows:
a). /usr/local/nagios/libexec/check_http -H <new_nagiosxi_server_IP>
Result: HTTP WARNING: HTTP/1.1 403 Forbidden
b). /usr/local/nagios/libexec/check_http -H <new_nagiosxi_server_IP> -u "/nagiosxi"
Result: HTTP OK: HTTP/1.1 301 Moved Permanently
c). /usr/local/nagios/libexec/check_http -H <any_website, ex. google.com or internal website we host>
Result: HTTP OK: HTTP/1.1 301 Moved Permanently
SOLUTION: "Re-engineered" NagiosXI localhost check_http temporarily until a possible better "fix" is identified.
1). Stopped Apache and NagiosXI on server
2). Edited the "/usr/local/nagios/etc/services/localhost.cfg" file:
a). Changed the following:
define service {
commented out: use local-service
added: use xiwizard_website_http_service
added: contacts nagiosadmin
commented out: check_command check_http
added: check_command check_xi_service_http! -f ok -I <new_nagiosxi_server_IP> -u '/nagiosxi' -p 80
Either I leave this, or wait for a solution from Nagios XI tech team, or delete the localhost check, since if I can connect/access the Nagios XI web console, then Apache is working at least.