Page 1 of 1

Error in configuration file - NULL Value

Posted: Tue Jul 22, 2014 2:31 pm
by rlam
Hi,

I'm using Chef and nagios cookbooks to provision servers and in the past few days, Nagios hasn't been working properly.
When provisioning, I'm getting this error.

================================================================================
Error executing action `start` on resource 'service[nagios]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/nagios start ----
STDOUT: Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.

and running nagios -v hosts.cfg

Error in configuration file '/etc/nagios3/conf.d/hosts.cfg' - Line 4 (NULL value)

The top of my cfg file can be found here.
https://gist.github.com/mrlamroger/4f16b12ea5961ab53078

I've tried using a minimal cfg file and still get the same NULL value error.
I've tried running `file hosts.cfg` and it returned ASCII text.
The hostgroups are consistent with the hostgroups.cfg

Any suggestions would be appreciated. Thank you!

Re: Error in configuration file - NULL Value

Posted: Wed Jul 23, 2014 4:01 pm
by tmcdonald
You are supposed to run nagios -v against nagios.cfg like so:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Running it against your host.cfg file will not work.

Re: Error in configuration file - NULL Value

Posted: Thu Jul 24, 2014 12:53 pm
by rlam
Thanks! I need to read more carefully.