Nagios – Resolving a HTTP Service Warning HTTP/1.1 403 Forbidden

Nagios – Resolving a HTTP Service Warning  HTTP/1.1 403 Forbidden

This article provides details on how to resolve a HTTP Warning for the the HTTP service on the Nagios server when running on CentOS 7.

To resolve the warning so that it shows as OK perform the following steps:

  • Login to the Nagios server
  • Edit the file /usr/local/nagios/etc/objects/localhost.cfg
  • Locate the HTTP service and change the check_command to the following:
define service {
  use                      local-service
  host_name                NAG-REMOTE
  service_description      HTTP
  check_command            check_http!--expect="403"
  notifications_enabled    0
}
  • Save and exit the file
  • Restart the Nagios service by executing the following:
systemctl restart nagios

The changed command will now expect the 403 forbidden message and now give a result of OK rather than a WARNING.