Stuck with config, nagios won't start


Got in Nagios web interface but every link I click on shows this:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I haven’t done anything on this page yet except this command:
/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin…nfig_web_users

I could not really understand everything starting from…

“Enabling Authentication/Authorization Functionality In The CGIs”

Perhaps you can please explain this to me, I’m guessing having not done this portion yet is probably why I’m getting the errors when clicking on the links

Apache error logs

[Mon Jul 3 22:17:24 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/status.cgi
[Mon Jul 3 22:17:24 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml
[Mon Jul 3 22:17:24 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/status.cgi
[Mon Jul 3 22:17:24 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml
[Mon Jul 3 22:17:25 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/tac.cgi
[Mon Jul 3 22:17:25 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml
[Mon Jul 3 22:17:29 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/extinfo.cgi
[Mon Jul 3 22:17:29 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml
[Mon Jul 3 22:17:29 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/extinfo.cgi
[Mon Jul 3 22:17:29 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml
[Mon Jul 3 22:17:51 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/tac.cgi
[Mon Jul 3 22:17:51 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml
[Mon Jul 3 22:17:52 2006] [error] [client] Premature end of script headers: /usr/local/nagios/sbin/tac.cgi
[Mon Jul 3 22:17:52 2006] [error] [client] File does not exist: /home/user/public_html/500.shtml


root@server [/usr/local/nagios/etc]# /usr/local/nagios/bin/nagios -v nagios.cfg

Nagios 2.4
Copyright © 1999-2006 Ethan Galstad (
Last Modified: 05-31-2006
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Error: There are no services defined!
Checked 0 services.
Checking hosts…
Error: There are no hosts defined!
Checked 0 hosts.
Checking host groups…
Error: There are no host groups defined!
Checked 0 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Error: There are no contacts defined!
Checked 0 contacts.
Checking contact groups…
Error: There are no contact groups defined!
Checked 0 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 22 commands.
Checking time periods…
Checked 0 time periods.
Checking extended host info definitions…
Checked 0 extended host info definitions.
Checking extended service info definitions…
Checked 0 extended service info definitions.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors: 5

***> One or more problems was encountered while running the pre-flight check…

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
’Whats New’ section to find out what has changed.

I saw that in nagios.cfg it shows this:


This is the configuration file in which you define hosts, host

groups, contacts, contact groups, services, etc. I guess it would

be better called an object definition file, but for historical

reasons it isn’t. You can split object definitions into several

different config files by using multiple cfg_file statements here.

Nagios will read and process all the config files you define.

This can be very useful if you want to keep command definitions

separate from host and contact definitions…

Plugin commands (service and host check commands)

Arguments are likely to change between different releases of the

plugins, so you should use the same config file provided with the

plugin release rather than the one provided with Nagios.


Misc commands (notification and event handler commands, etc)


You can split other types of object definitions across several

config files if you wish (as done here), or keep them all in a

single config file.



The above cfg files do not exist by default and this is where I am confused to what the lines should look like in each file. I saw this link…te_host_checks but I’m not 100% sure on this.

Can someone at least give me one example per file (the above)? I think that should help me out.


hi all

I am installing nagios for very first time. After installation and configuration, I have verified using the following command and received no error.
/usr/local/nagios/bin/nagios -v <main_config_file>.

When i point my browser to the nagios, i receive an error as

“Error: Could not read object configuration data!”.

what is the problem ? Is it necessary to compile template based object configuration files ? If yes how to do that ?

Please help me !!! i am trying to rectify this problem for past two days.



“Premature end of script headers:” sounds like your compile failed, and you missed the errors. So, this time, run ./configure again and this time, make sure you look at each and every line of output. One of them is going to say somthing like “missing this, or missing that”.

Error: Could not read object configuration data!".“
That could mean that nagios is NOT running.
ps -ef|grep nagios


There seems to be nothing, hosts or services, configured. Have a look in the /usr/local/nagios/etc for the sample config files.