Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-03-2005, 07:34 AM   #1
Registered: Mar 2005
Posts: 103

Rep: Reputation: 15
Nagios problem

I am getting this error in web interface and command prompt

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

Nagios 2.0b4
Copyright (c) 1999-2005 Ethan Galstad ( Last Modified: 08-02-2005
License: GPL

Reading configuration data...

Error: Command 'check-host-alive' has already been defined
Error: Could not register command (config file '/usr/local/nagios/etc/minimal.cfg', starting on line 76)

***> One or more problems was encountered while processing the config files...

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.

***This is the last portion of my httpd.conf file (restarted httpd 3 times after adding this to the httpd.conf***

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin <Directory "/usr/local/nagios/sbin">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Alias /nagios /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

<Directory /usr/local/nagios/sbin>
AllowOverride AuthConfig
order allow,deny
allow from all
Options ExecCGI

<Directory /usr/local/nagios/share>
AllowOverride AuthConfig
order allow,deny
allow from all

***This is the default Nagios.cfg file as well (only top portion to show default settings***


Why am I getting all these errors above? I also get 404 error in Nagios web interface when I click any link

My specs:

PHP 4.4.0
Apache 1.33x
Mysql 4.1
Latest stable Nagios
APF firewall
BFD intrusion protection

I commented out miscommands and checkommands in nagios.cfg (did not find any command.cfg in that file) and restarted Nagios. I still get this error anytime I click on the links in the web interface:

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 did the pre-flight check as well. All looks good at least on that part.

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

Nagios 2.0b4
Copyright (c) 1999-2005 Ethan Galstad ( Last Modified: 08-02-2005
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
Checked 5 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 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 8 commands.
Checking time periods...
Checked 1 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: 0

Things look okay - No serious problems were detected during the pre-flight check

This is what I find in the server error log:

Oct 3 07:21:42 server3 nagios: HOST NOTIFICATION: nagios-admin;localhost;DOWN;host-notify-by-email;/bin/ping -n -U -w 10 -c 1 Oct 3 07:21:42 server3 nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\nHost: localhost\nState: DOWN\nAddress: 127.0.0.$ Oct 3 07:23:42 server3 nagios: SERVICE ALERT: localhost;PING;UNKNOWN;HARD;1;/bin/ping -n -U -w 10 -c 5

Last edited by I_AM; 10-03-2005 at 07:37 AM.
Old 10-03-2005, 03:22 PM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
The way it reads to me:

On (or just above) line 76 In a file named:


You have attempted to define a command called:


The command has already been defind elsewhere.

Therefore you likely either have "check-host-alive" twice within the above mentioned file OR you have it there once and in another file once. I don't use minimal.cfg on my nagios installation. Mosf of my commands are defined in check_commands.cfg and called by my services.cfg.

You might just try the following:

cd /usr/local/nagios/etc
grep check-host-alive *.cfg

The above will give you any config file that contains the name "check-host-alive". You can examine these and see if in fact there is a duplicate command definition. Note that seeing it multiple times in services.cfg is NOT an issue so long as it is defined for different hosts or hostgroups within that file.

Once you've done the grep just do a vi of each of the files it gives you.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios IP problem sumux Linux - Software 0 11-18-2005 06:19 AM
Nagios Problem kingcomein Linux - General 4 11-09-2005 11:31 PM
Nagios problem denis Linux - Software 1 04-27-2005 11:23 AM
Nagios Problem sbrewer Linux - Software 1 12-19-2004 04:49 AM
Nagios Problem kopite2012 Linux - Newbie 9 04-02-2004 11:21 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration