"Unallocated" hostgroup? Trying to remove a hostgr


#1

I have inherited a Nagios installation when the old admin left. He was in the middle of getting the configuration finished so there is a lot of stuff missing.

One of the things he did (and I’m not sure how much of this is default behavior and how much is what he did) is create a hostgroup named “Unallocated” that does not have any members in it. Somehow it’s getting ALL the hosts defined in Nagios. Not only that but when I remove it and run the verification script the script throws errors saying that various hosts are looking for the Unallocated group, even though it’s not in their host.cfg files.

Any help would be appreciated.


#2

Mabye he added the hostgroups variable into one of the templates and all of your host configurations are inheriting that?


#3

Here’s a host def that’s having the issue:

[root@gsosv-nagios hosts]# cat fcsw1.cfg
define host{
        use                     generic-host
        host_name               gsosv-fcsw1
        alias                   gsosv-fcsw1
        address                 198.85.102.186
        notification_interval   120
        notification_period     24x7
        contact_groups          admins
        }

define hostextinfo{
        host_name       gsosv-fcsw1
        notes           This is the first Brocade SAN switch
        }


define service{
        use                             generic-service
        host_name                       gsosv-fcsw1
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            1
        notification_interval           120
        contact_groups                  admins
        notification_period             24x7
        }

define service{
        use                             generic-service
        host_name                       gsosv-fcsw1
        service_description             HTTP
        check_command                   check_http!-e HTTP/1.1
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            1
        notification_interval           120
        contact_groups                  admins
        notification_period             24x7
        }

define service{
        use                             generic-service
        host_name                       gsosv-fcsw1
        service_description             Telnet
        check_command                   check_tcp!23
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            1
        notification_interval           120
        contact_groups                  admins
        notification_period             24x7
        }

and here is the hostgroup def itself:

define hostgroup{ hostgroup_name Unallocated alias Hosts unallocated to a proper group. members }


#4

did you look at the generic-host template?


#5

Does this template apply to all hosts no matter what? (The setting is in there, going to remove it and restart nagios).

Edit: so I removed that line and now the config checker does not like me anymore. How do I get it to stop choking on the template.cfg with out having it put everything into Unallocated by default?


#6

It applies to all host objects configured with

define host{ use generic-host ...

You should just need to remove the one hostgroups line from the template. Post the error you are getting with -v and the template being used and we will see what’s what.


#7

It does not like it when I remove that line from the template:

Reading configuration data...

Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/objects/hostgroups.cfg', starting on line 42)

***> One or more problems was encountered while processing the config files...

Is there a decent book on how to configure and troubleshoot Nagios? The online documents are very difficult for me to follow, the examples are clear but 2/3 of the time when I do something that they show it does not work in my environment.


#8

probably need to look in /usr/local/nagios/etc/objects/hostgroups.cfg then, somewhere around line 42 and see whats going on there… I believe there is a decent nagios book but I don’t recall what its called, and whether or not it has been updated for v3 is anyones guess…