Host member not displayed in group, but Nagios starts

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
mello
Posts: 8
Joined: Mon Jun 20, 2016 8:33 am

Host member not displayed in group, but Nagios starts

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Host member not displayed in group, but Nagios starts

Post by dwhitfield »

For the sake of clarity, you are saying everything livingroom and after did not show up in the GUI, correct?
mello
Posts: 8
Joined: Mon Jun 20, 2016 8:33 am

Re: Host member not displayed in group, but Nagios starts

Post 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 :roll:
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Host member not displayed in group, but Nagios starts

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mello
Posts: 8
Joined: Mon Jun 20, 2016 8:33 am

Re: Host member not displayed in group, but Nagios starts

Post by mello »

Will upgrade and test. Thanks for your reply.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Host member not displayed in group, but Nagios starts

Post by tmcdonald »

We'll keep this open for you.
Former Nagios employee
Locked