CONFIG ERROR! Check your Nagios configuration


#1

Hello,

With NAGIOS V3.2.1, If I modify the windows.cfg file :

define host{
use windows-server ; Inherit default values from a template
host_name msuntec7 ; The name we’re giving to this host
alias Server MSUNTEC7 ; A longer name associated with the host
address 192.168.2.199 ; IP address of the host
}

when I restart NAGIOS, I get the message:

Running configuration check… CONFIG ERROR! Restart aborted. Check your Nagios configuration.

If I create a hosts.cfg file with:

more hosts.cfg
define host {
host_name msuntec19
use generic-host
alias Serveur Linux pour Model Book
address 192.168.2.189

I have the same error!!

Why??

any idea how to debug this type of error??

Thanks


#2

try running:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

and check the output.


#3

Nagios Core 3.2.1
Copyright © 2009-2010 Nagios Core Development Team and Community Contributors
Copyright © 1999-2009 Ethan Galstad
Last Modified: 03-09-2010
License: GPL

Website: nagios.org
Reading configuration data…
Read main config file okay…
Processing object config file ‘/usr/local/nagios/etc/objects/commands.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/contacts.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/timeperiods.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/templates.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/hosts.cfg’…
Processing object config file ‘/usr/local/nagios/etc/objects/localhost.cfg’…
Error: Invalid max_check_attempts value for host 'msuntec19’
Error: Could not register host (config file ‘/usr/local/nagios/etc/objects/hosts.cfg’, starting on line 1)
Error processing object config files!


#4
define host {
host_name msuntec19
use generic-host
alias Serveur Linux pour Model Book
address 192.168.2.189

If you don’t use a template you have to define some more directives:
nagios.sourceforge.net/docs/3_0/ … .html#host
Note: Directives in red are required, while those in black are optional.

That’s one of the missing directives…


#5

It works

Thanks


#6

The logs are probably deleted or archived in a different position. Check that first.


#7

There’s probably some cronjob deleting the files or archiving them. Who created the server infrastructure? ask these people or check your internal docs.


#8

I also got solution from your post as I am also facing the same problem. I have tried to solve this problem but can not success because of some problems in programming. After visiting the above post I thought to try it and it has solved my problem.