Configuration Error on pre-flight


#1

Ok here is my problem, am getting the following error and i cant trace where else there might be a 2 commands.cfg file
**Error: Command ‘check-host-alive’ has already been defined
Error: Could not register command (config file ‘/usr/local/nagios/etc/commands.cfg’, starting on line 181)
**
When i go to line 181 am i supposed to change the command or is it possible to have a duplicate of the commands.cfg file? and if so where is it?


#2

/usr/local/nagios/etc/nagios.cfg is like your master config file. From this file, it will include various other files (one of which will be your commands.cfg file). Have a look through these and you should find your duplicate. You can have as many or as few config files as you like. One nice diagram showing a neat way of doing them can be found here: nagios.sourceforge.net/download/ … config.png

You might find that you have a config file called “minimal.cfg” or something like that; it’s just an example and you’ll probably want to split it down in to separate files once you work out what the various objects are for.


#3

So you are saying that i should create seperate files from the minimal file?


#4

Yes. It’s up to you though.

The key to getting rid of the error is seeing which config files are being referenced from nagios.cfg and getting rid of any duplicate object definitions.

You can split your configuration down in to separate files later if you like. Once you start monitoring more than half a dozen hosts, you’ll find you pretty much need to just to keep it all manageable.


#5

Ok my pre-flight test ran ok and thank you so much! Now i cant access the web interface. Apache is giving me a Forbidden Error! It then goes ahed and says that there’s an internal server error and that i cant access my request. All the permissions are set ok and then when i try to access the /localhost/nagios/cgi-bin i get an access denied whenever i type in my username and password according to the httpd.users file.
Where might the error be?


#6

httpd.users file? Where is that in the docs?
"All the permissions are set ok and then when i try to access the /localhost/nagios/cgi-bin i get an access denied"
How is that? If the permissions are right, then why is it “access denied”?
You didn’t install from source did you? If not, then please remove your rpm install and install from source following the nagios docs.