Error in configuration file - NULL Value

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rlam
Posts: 3
Joined: Tue Jul 22, 2014 11:27 am

Error in configuration file - NULL Value

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Error in configuration file - NULL Value

Post 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.
Former Nagios employee
rlam
Posts: 3
Joined: Tue Jul 22, 2014 11:27 am

Re: Error in configuration file - NULL Value

Post by rlam »

Thanks! I need to read more carefully.
Locked