[solved] Not showing configuration error

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
CaptSpify
Posts: 3
Joined: Mon Jan 11, 2016 9:23 pm

[solved] Not showing configuration error

Post by CaptSpify »

Hello
I have a nagios instance that seems to be misconfigured. Here's the message I get:

Code: Select all

kyelw@nagios1 ~ $ sudo /usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg                                                       

Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/etc/nagios3/commands.cfg'...
Processing object config directory '/etc/nagios-plugins/config'...
Processing object config file '/etc/nagios-plugins/config/disk.cfg'...
Processing object config file '/etc/nagios-plugins/config/mysql.cfg'...
Processing object config file '/etc/nagios-plugins/config/ldap.cfg'...
Processing object config file '/etc/nagios-plugins/config/apt.cfg'...
Processing object config file '/etc/nagios-plugins/config/flexlm.cfg'...
Processing object config file '/etc/nagios-plugins/config/telnet.cfg'...
Processing object config file '/etc/nagios-plugins/config/rpc-nfs.cfg'...
Processing object config file '/etc/nagios-plugins/config/ifstatus.cfg'...
Processing object config file '/etc/nagios-plugins/config/nt.cfg'...
Processing object config file '/etc/nagios-plugins/config/dhcp.cfg'...
Processing object config file '/etc/nagios-plugins/config/load.cfg'...
Processing object config file '/etc/nagios-plugins/config/mrtg.cfg'...
Processing object config file '/etc/nagios-plugins/config/dummy.cfg'...
Processing object config file '/etc/nagios-plugins/config/procs.cfg'...
Processing object config file '/etc/nagios-plugins/config/ping.cfg'...
Processing object config file '/etc/nagios-plugins/config/hppjd.cfg'...
Processing object config file '/etc/nagios-plugins/config/snmp.cfg'...
Processing object config file '/etc/nagios-plugins/config/mailq.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk-smb.cfg'...
Processing object config file '/etc/nagios-plugins/config/ntp.cfg'...
Processing object config file '/etc/nagios-plugins/config/mail.cfg'...
Processing object config file '/etc/nagios-plugins/config/ftp.cfg'...
Processing object config file '/etc/nagios-plugins/config/games.cfg'...
Processing object config file '/etc/nagios-plugins/config/users.cfg'...
Processing object config file '/etc/nagios-plugins/config/tcp_udp.cfg'...
Processing object config file '/etc/nagios-plugins/config/real.cfg'...
Processing object config file '/etc/nagios-plugins/config/dns.cfg'...
Processing object config file '/etc/nagios-plugins/config/ssh.cfg'...
Processing object config file '/etc/nagios-plugins/config/pgsql.cfg'...
Processing object config file '/etc/nagios-plugins/config/http.cfg'...
Processing object config file '/etc/nagios-plugins/config/news.cfg'...
Processing object config file '/etc/nagios-plugins/config/netware.cfg'...
Processing object config file '/etc/nagios-plugins/config/check_nrpe.cfg'...
Processing object config file '/etc/nagios-plugins/config/fping.cfg'...
Processing object config file '/etc/nagios-plugins/config/radius.cfg'...
Processing object config file '/etc/nagios-plugins/config/breeze.cfg'...
Processing object config directory '/etc/nagios3/conf.d'...
Processing object config file '/etc/nagios3/conf.d/contactgroups.cfg'...
Processing object config file '/etc/nagios3/conf.d/hostgroups.cfg'...
Processing object config file '/etc/nagios3/conf.d/commands.cfg'...
Processing object config file '/etc/nagios3/conf.d/hosts.cfg'...
Processing object config file '/etc/nagios3/conf.d/services.cfg'...
Processing object config file '/etc/nagios3/conf.d/contacts.cfg'...
Processing object config file '/etc/nagios3/conf.d/templates.cfg'...
Processing object config file '/etc/nagios3/conf.d/timeperiods.cfg'...
   Error processing object config files!


***> 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.

What's weird to me is: I'm used to seeing nagios say "error on line: 265" or whatever. But this time, it's not giving me a location where the error is occurring. All it really says is "Error processing object config files!" I've checked, and all the files are owned by the nagios user, and group.

Any other help or suggestions as to where look would be appreciated!

Thanks
Last edited by CaptSpify on Wed Jan 13, 2016 12:22 pm, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Not showing configuration error

Post by rkennedy »

Can you post the contents of this file for us to take a look at?

Code: Select all

/etc/nagios3/conf.d/timeperiods.cfg
Former Nagios Employee
CaptSpify
Posts: 3
Joined: Mon Jan 11, 2016 9:23 pm

Re: Not showing configuration error

Post by CaptSpify »

Sure, but I think that's a red-herring.

Code: Select all

 $ cat /etc/nagios3/conf.d/timeperiods.cfg
define timeperiod {
  timeperiod_name 24x7
  alias           24 Hours A Day, 7 Days A Week
  sunday          00:00-24:00
  monday          00:00-24:00
  tuesday         00:00-24:00
  wednesday       00:00-24:00
  thursday        00:00-24:00
  friday          00:00-24:00
  saturday        00:00-24:00
}
The reason I think it's not the issue is that if I remove it, I get the same error, just sooner:

Code: Select all

....
Processing object config file '/etc/nagios3/conf.d/services.cfg'...
Processing object config file '/etc/nagios3/conf.d/contacts.cfg'...
Processing object config file '/etc/nagios3/conf.d/templates.cfg'...
   Error processing object config files!


***> 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.
Also, that is the last file in the config directory, so it wouldn't be a file after it:

Code: Select all

$ ls /etc/nagios3/conf.d/
commands.cfg  contactgroups.cfg  contacts.cfg  hostgroups.cfg  hosts.cfg  services.cfg  templates.cfg
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not showing configuration error

Post by lmiltchev »

Can you zip up the entire "/etc/nagios3/" directory and PM it to me? Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not showing configuration error

Post by lmiltchev »

I sent you a PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
CaptSpify
Posts: 3
Joined: Mon Jan 11, 2016 9:23 pm

Re: Not showing configuration error

Post by CaptSpify »

For those playing along at home, it ended up being 2 things:

1) empty hostgroups in hosts.cfg

Code: Select all

define host {
use server
address 192.168.1.1
host_name servername
hostgroups <blank>
}
and hostgroups defined in services.cfg, but not in hostgroups.cfg:

Code: Select all

define hostgroup{
        hostgroup_name       hostgroup1
        members                  servername
  }
/code]

Still no idea why it wasn't showing a line-number for the error |:(

Many thanks to lmiltchev !
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: [solved] Not showing configuration error

Post by hsmith »

Glad to hear he got it working for you. I'll close this one up.
Former Nagios Employee.
me.
Locked