Page 1 of 2
Pre-flight error, but i cant see it :(
Posted: Mon Mar 06, 2017 4:57 am
by FTL
Hi,
Been staring at this and getting no where so time for a fresh pair of eyes.
Relevant parts of the config file attached. (now removed)
However with the host escalations in, the pre flight moans saying:
Error: Could not find any host matching 'GNATBOX FTL' (config file bla bla bla)
Error: Could not expand hostgroups and/or hosts specified in host escalation (config file bla bla bla)
It will do this for all 3 hosts listed if i comment the escalation out 1 by 1
Comment the host escalations out completely and pre flight is happy.
Same for service escalations for the same hosts, altohugh i havnt included in the config file as behaviour is the same as host escalations so not needed.
Got the same setup for over 200 other hosts and they are all fine.
Can a fresh pair of eyes please point out what im sure is a glaringly obvious mistake that im just not seeing?
Thanks
Re: Pre-flight error, but i cant see it :(
Posted: Mon Mar 06, 2017 12:32 pm
by dwhitfield
What happens if you run /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg?
If it seg faults, please run strace /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg >& /tmp/nagiosstrace.txt and attach the trace.
Thanks!
Re: Pre-flight error, but i cant see it :(
Posted: Mon Mar 06, 2017 4:30 pm
by tmcdonald
Just got out of a remote with someone experiencing the same issue, but only for a host/service that does not exist. Is it possible you have a typo in your configs? If you can give us the exact line that this errors on, or better yet the strace output, that will help us narrow down the error.
Re: Pre-flight error, but i cant see it :(
Posted: Tue Mar 07, 2017 4:43 am
by FTL
Hi,
Please see the requested info.
I have included the whole config file with some sanitization to help things along rather than a cut and paste job.
Output of /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Code: Select all
root@LVL3-NAGIOS:~# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/switches_firewalls.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/servers.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/websites.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/webservices.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/pnp4nagios_templates.cfg'...
Error: Could not find any host matching 'GNATBOX FTL' (config file '/usr/local/nagios/etc/objects/switches_firewalls.cfg', starting on line 667)
Error: Could not expand hostgroups and/or hosts specified in host escalation (config file '/usr/local/nagios/etc/objects/switches_firewalls.cfg', starting on line 667)
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.
strace and config file attached.
Thankyou for your time
Re: Pre-flight error, but i cant see it :(
Posted: Tue Mar 07, 2017 1:28 pm
by mcapra
It looks as if the issue is that there is no Host object defined with the name "GNATBOX FTL". If that doesn't sound right, can you share your configuration set?
Re: Pre-flight error, but i cant see it :(
Posted: Wed Mar 08, 2017 9:47 am
by FTL
mcapra wrote:It looks as if the issue is that there is no Host object defined with the name "GNATBOX FTL". If that doesn't sound right, can you share your configuration set?
Hi, the config file is posted in its entirity as an attachment in the post above your reply.
GNATBOX FTL is there as a host - very first host at the top of the config.
Re: Pre-flight error, but i cant see it :(
Posted: Wed Mar 08, 2017 5:06 pm
by tgriep
Could you post the Host Configuration file for the GNATBOX FTL host?
Maybe there is a bad setting in that file causing the error.
Re: Pre-flight error, but i cant see it :(
Posted: Wed Mar 08, 2017 5:28 pm
by mcapra
This actually looks like a spacing issue with how the host is defined:

- 2017_03_08_16_27_56_C_Users_mcapra_Downloads_switches_firewalls_1_.cfg_Notepad_.png (6.05 KiB) Viewed 4255 times
A tab seems to be used in the host definition, where a space is used in the hostescalation definition. Can you try modifying those particular definitions to see if this observation is consistent?
Re: Pre-flight error, but i cant see it :(
Posted: Tue Mar 14, 2017 5:18 pm
by FTL
mcapra you star.
Nailed it.
Thankyou

Re: Pre-flight error, but i cant see it :(
Posted: Wed Mar 15, 2017 10:02 am
by cdienger
mcapra is kind of the man

Are we safe to assume this can be closed or were there any more questions?