Page 1 of 1
Host member not displayed in group, but Nagios starts
Posted: Mon Oct 03, 2016 11:06 am
by mello
Sorry if not the right place and if has been discussed - I couldn't find with my searches, but we never know.
I've noticed that, because my bad English grammar, three of the cameras I was monitoring via ping weren't showing in the group, although I could see them as hosts.
Problem was that I've misspelled the host name in the group and it was correct in the host/service definition above (It was leavingroom instead of livingroom until my son started laughing at me).
The thing is that Nagios started, but only displayed in the group up (not inclusive) to that misspelled/mistype host.
I'm still at:
NagiosĀ® Coreā¢
Version 4.0.8
So it could be fixed on 4.2.1.
My config file has this as host group:
# Define an optional hostgroup for Cameras
#
define hostgroup{
hostgroup_name cameras ; The name of the hostgroup
alias ZM Cameras ; Long name of the group
members driveway,frontdoor,backporch,rightback,livingroom,kitchen,office
}
So the GUI only showed up to rightback, but no errors from starting Nagios.
Just sharing.
Re: Host member not displayed in group, but Nagios starts
Posted: Mon Oct 03, 2016 12:47 pm
by dwhitfield
For the sake of clarity, you are saying everything livingroom and after did not show up in the GUI, correct?
Re: Host member not displayed in group, but Nagios starts
Posted: Mon Oct 03, 2016 12:49 pm
by mello
And, just to clarify:
I think if there are missing hosts in a group, that should be flagged. In my case, caused by my misspelling

Re: Host member not displayed in group, but Nagios starts
Posted: Mon Oct 03, 2016 2:55 pm
by lmiltchev
Misspelling should give you a config error...
Here's a test in Nagios 4.2.0.
hostgroups.cfg
Code: Select all
define hostgroup{
hostgroup_name SERVERS-NAGIOS
alias Servers Nagios
members nagios2
}
Verifying the config:
Code: Select all
[root@localhost objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.2.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-01-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 22 services.
Checked 5 hosts.
Checked 3 host groups.
Checked 0 service groups.
Checked 3 contacts.
Checked 3 contact groups.
Checked 30 commands.
Checked 7 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 5 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 7 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
hostgroups.cfg //Misspelling the member's name
Code: Select all
define hostgroup{
hostgroup_name SERVERS-NAGIOS
alias Servers Nagios
members negios2
}
Verifying the config again:
Code: Select all
[root@localhost objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.2.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-01-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'negios2' (config file '/usr/local/nagios/etc/objects/hostgroups.cfg', starting on line 1)
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/objects/hostgroups.cfg', starting on line 1)
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.
Re: Host member not displayed in group, but Nagios starts
Posted: Mon Oct 03, 2016 3:24 pm
by mello
Will upgrade and test. Thanks for your reply.
Re: Host member not displayed in group, but Nagios starts
Posted: Mon Oct 03, 2016 4:47 pm
by tmcdonald
We'll keep this open for you.