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.
# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description HTTP
check_command check_http
notifications_enabled 0
}
Can you run this again as it's using the -I (capital i) argument whereas @tmcdonald's command used the -H argument AND a dns name instead of an IP Address.
Can you run this again as it's using the -I (capital i) argument whereas @tmcdonald's command used the -H argument AND a dns name instead of an IP Address.
GET / HTTP/1.0
User-Agent: check_http/v2.1.1 (nagios-plugins 2.1.1)
Connection: close
Accept: */*
http://127.0.0.1:80/ is 810 characters
STATUS: HTTP/1.1 500 Internal Server Error
**** HEADER ****
Date: Thu, 03 Sep 2015 00:45:50 GMT
Server: Apache/2.2.15 (CentOS)
Content-Length: 618
Connection: close
Content-Type: text/html; charset=iso-8859-1
**** CONTENT ****
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at admin.qa.pdone.com Port 80</address>
</body></html>
HTTP CRITICAL: HTTP/1.1 500 Internal Server Error - 810 bytes in 0.001 second response time |time=0.001303s;;;0.000000 size=810B;;;0
Thanks to @Box293 who point me on the right direction, after ran the latest command I can see where the issue was: bad configuration at VirtualHost definition in Apache side. Moving the localhost definition to the top make all services works good and Nagios stop showing me the CRITICAL flag. Also I did add a new ServerAlias 127.0.0.1. The VH definition looks like:
<VirtualHost *:80>
ServerName localhost
ServerAlias xxx.xxx.xxx.xxx (public IP address)
ServerAlias 127.0.0.1
DocumentRoot /var/www/html
<Directory /var/www/html>
# enable the .htaccess rewrites
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>