Pre-flight error, but i cant see it :(

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.
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Pre-flight error, but i cant see it :(

Post 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
Last edited by FTL on Tue Mar 07, 2017 4:48 am, edited 2 times in total.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Pre-flight error, but i cant see it :(

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

Re: Pre-flight error, but i cant see it :(

Post 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.
Former Nagios employee
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Pre-flight error, but i cant see it :(

Post 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
Last edited by FTL on Tue Mar 14, 2017 5:19 pm, edited 1 time in total.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Pre-flight error, but i cant see it :(

Post 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?
Former Nagios employee
https://www.mcapra.com/
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Pre-flight error, but i cant see it :(

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Pre-flight error, but i cant see it :(

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Pre-flight error, but i cant see it :(

Post by mcapra »

This actually looks like a spacing issue with how the host is defined:
2017_03_08_16_27_28_C_Users_mcapra_Downloads_switches_firewalls_1_.cfg_Notepad_.png
2017_03_08_16_27_56_C_Users_mcapra_Downloads_switches_firewalls_1_.cfg_Notepad_.png
2017_03_08_16_27_56_C_Users_mcapra_Downloads_switches_firewalls_1_.cfg_Notepad_.png (6.05 KiB) Viewed 3605 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?
Former Nagios employee
https://www.mcapra.com/
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Pre-flight error, but i cant see it :(

Post by FTL »

mcapra you star.

Nailed it.

Thankyou :)
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Pre-flight error, but i cant see it :(

Post by cdienger »

mcapra is kind of the man :) Are we safe to assume this can be closed or were there any more questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked