Removed host groups - Can't apply Config

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Removed host groups - Can't apply Config

Post by slansing »

This may be because you have assigned the hosts to the hostgroups and not the other way around, if a object is linked to another one direction, it will be greyed out when trying to add them from the other end. Are you still receiving configuration errors?
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Removed host groups - Can't apply Config

Post by jbennett »

They aren't greyed out and I'm not getting any config errors any more.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Removed host groups - Can't apply Config

Post by lmiltchev »

Just to clarify...

When you go to:

CCM->Hosts->...->Modify->Manage Hostgroups

you don't see any of the hostgroups you would like to remove listed?

...and if you go to:

CCM->Host Groups->...->Modify->Manage Hosts

you don't see any hosts (members), assigned to this hostgroup?

Is this correct?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Removed host groups - Can't apply Config

Post by jbennett »

That is correct.

But the host group is clearly listed in the host config file when I check there.

If I check the hostgroup.cfg file, the host groups are listed, but no hosts are listed.

I should note that when I check the host group via the host, some of the host groups that were there to begin with, that were never deleted, are greyed out but are not listed on the right under 'Assigned'.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Removed host groups - Can't apply Config

Post by abrist »

jbennett wrote: I should note that when I check the host group via the host, some of the host groups that were there to begin with, that were never deleted, are greyed out but are not listed on the right under 'Assigned'.
If the hostgroups are greyed out in a host's management interface, then the hostgroup was added to the host from either the hostgroup configuration or from another hostgroup that is a member of the hostgroup in question. Ir you may have a ghost config . . . .
List the hosts directory sorted by date. If any files are noticeably older, you may have some ghosted configs:

Code: Select all

ls -lat /usr/local/nagios/etc/hosts
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Removed host groups - Can't apply Config

Post by jbennett »

I have a number of configs that are from Oct. 19, 2012, but those are not the hosts in question. I also have a number that are from Jul 9, 2013 that should be disabled.

I'm not sure I follow how to resolve this once I've identified the host configs?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Removed host groups - Can't apply Config

Post by abrist »

Usually, the best course of action is to remove those old files. Do note, that you may want to move them or rename them first as there is a change a portion of your config may rely on one or more of the ghost in order to pass verification.

Code: Select all

mkdir /tmp/old_configs
Repeat the line below for each old config (replacing </path/to/old/config/file> with the actual path of course):

Code: Select all

mv </path/to/old/config/file> /tmp/old_configs
Then, go to the CMM --> Configure --> Core Config Manager --> Tools --> Write Config Files --> Click "Write" and then "Verify". If everything verifies OK, you may now apply configuration. If you get errors, you must resolve them before you apply config or restart nagios as doing so will possibly rewrite the old configs back to the config directories. Please rewrite and reverify after resolving errors to see if there are any more.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Removed host groups - Can't apply Config

Post by jbennett »

I have done this, but I still have a number of disabled hosts that are showing up as being down. While it is true that those hosts are down, I no longer need the host check as I have a service check that it being done via NRDS for the host status that is far more reliable.

These hosts were assigned to a host group. I cannot remove thoses hosts from the host group, even after following the suggested methods below since they don't ever show up.

I'm not sure that I should remove the configs (move or rename them even) that are from July 9th as I'm not looking to completely delete the configs just yet. I just want Nagios to stop checking them (check_icmp) for the time being.

In short - it appears that even though I have the hosts deactivated, they are still active somehow due to being a part of a host group that was deleted, then added back. I cannot remove the host from the host group as it doesn't show up in the Nagios interface, only when checking the host .cfg file.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Removed host groups - Can't apply Config

Post by slansing »

As far as stoping them from checking, you could as was mentioned "deactivate them" via the CCM, or you could disable active/passive checks on a host by host basis in it's details > advanced tab page.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Removed host groups - Can't apply Config

Post by jbennett »

That's what i'm saying. I have deactivated them via the CCM, yet they're still showing up.
Locked