Removed host groups - Can't apply Config
Removed host groups - Can't apply Config
In an effort to clean up some things on our server, I'm removing some needless host groups that were created a while back just to see functionality.
I've deleted the host groups, but I can't apply the config since some of the host.cfg files are still pointing to those host groups that no longer exist.
I've tried going to the host and checking the host group section only to find it empty (as expected).
Have I missed something here?
I've deleted the host groups, but I can't apply the config since some of the host.cfg files are still pointing to those host groups that no longer exist.
I've tried going to the host and checking the host group section only to find it empty (as expected).
Have I missed something here?
Re: Removed host groups - Can't apply Config
Go to --> CCM --> Tools --> Write Config Files. Click "Write" and "Verify". Post the output of each of these in code wraps.
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.
"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.
Re: Removed host groups - Can't apply Config
Code: Select all
Write host configurations ...
Host configuration files successfully written!
Write service configurations ...
Service configuration files successfully written!
Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!Code: Select all
Error: Could not find any hostgroup matching 'PGBT-MLP6-6' (config file '/usr/local/nagios/etc/hosts/PGBT-MLP6-7-IR Camera.cfg', starting on line 14)
Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config file '/usr/local/nagios/etc/hosts/......
...
...
...
...
Error: Could not find any hostgroup matching 'hostgroup_name' (config file '/usr/local/nagios/etc/hosts/host_config_name.cfg', starting on line 14)
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.
-
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
Looks like this host has a configuration definition pointing to the removed hostgroup, once this is changed configurations should apply:
Code: Select all
Error: Could not find any hostgroup matching 'hostgroup_name' (config file '/usr/local/nagios/etc/hosts/host_config_name.cfg', starting on line 14)
Error processing object config files! Re: Removed host groups - Can't apply Config
That's absolutely the issue and I'm fully aware that the obvious solution is to jsut recreate the host group.
The problem (as stated earlier in the thread) is that the couple hundred host groups were deleted, not knowing that this would be an issue.
If the host groups are deleted, they should be removed from the host automatically without having to manaully go to each of the 1750 or so hosts that I currently have monitored, open each one, and manually remove them from the hosts and THEN be able to delete the host groups.
I need a solution, that's why I posted the thread asking for help.
The problem (as stated earlier in the thread) is that the couple hundred host groups were deleted, not knowing that this would be an issue.
If the host groups are deleted, they should be removed from the host automatically without having to manaully go to each of the 1750 or so hosts that I currently have monitored, open each one, and manually remove them from the hosts and THEN be able to delete the host groups.
I need a solution, that's why I posted the thread asking for help.
Re: Removed host groups - Can't apply Config
This issue is a lot more complicated as it seems. At the moment, we don't have an elegant solution to remove host groups. I understand the reasoning behind this:
How did you add your hostgroups to hosts? Did you add these couple hundred hostsgroups manually to the 1750 hosts?! If you added members via the "Host Group Management", you could remove the hostgroup members in bulk, by clicking on "Remove All". If you did it "the other way", I have no good solution for you.
I believe, for the time being, you need to restore to your previous config snapshot:
so that you can Apply Configuration. After this is done, we can think of ways for safely removing these hostgroups... We need to know how you added them.
Hope this helps.
however, there are several layers of complexity here. Hosts can be added to hostsgroups as members under , or "Host Group Management" AND/OR hostgroups can be added to individual hosts under "Host Management". In addition to this, a service could be added to a hostgorup, and removing the hostgroup could lead to "reducing the number of your checks" significantly... Host groups can be added to hostgroups... So removing a hostgroup automatically is NOT the best option.If the host groups are deleted, they should be removed from the host automatically...
How did you add your hostgroups to hosts? Did you add these couple hundred hostsgroups manually to the 1750 hosts?! If you added members via the "Host Group Management", you could remove the hostgroup members in bulk, by clicking on "Remove All". If you did it "the other way", I have no good solution for you.
I believe, for the time being, you need to restore to your previous config snapshot:
Code: Select all
Admin->Monitoring Config->Config Snapshots->click on the "Restore" action buttonHope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Removed host groups - Can't apply Config
There might be an sql query to resolve it, by removing the hostgroups from the field. But, are these hosts a member of other hostgroups as well? (I ask because the sed/regex query may have to be written differently.)
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.
"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.
Re: Removed host groups - Can't apply Config
ok - I just went through and manually recreated all of the host groups exactly as they were named by creating them, attempting to apply configs, then seeing what it errored on.
I was able to apply the configs successfully now.
However, I still need to remove the host groups, so I'm assuming that I now have to go to each of my 1750+ hosts and manually remove the host group in order for this to work correctly?!
I was able to apply the configs successfully now.
However, I still need to remove the host groups, so I'm assuming that I now have to go to each of my 1750+ hosts and manually remove the host group in order for this to work correctly?!
Re: Removed host groups - Can't apply Config
lmiltchev wrote:How did you add your hostgroups to hosts? Did you add these couple hundred hostsgroups manually to the 1750 hosts?! If you added members via the "Host Group Management", you could remove the hostgroup members in bulk, by clicking on "Remove All". If you did it "the other way", I have no good solution for you.
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.
"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.
Re: Removed host groups - Can't apply Config
I'm afraid I've gotten stuck here and I'm not sure where to go next.
I recreated all of the host groups and applied the configs. Things went fine.
However, now when I go to either the host or the host groups via the GUI, there are no hosts assigned to the host groups. I don't even have the hosts that SHOULD be assigned (and are per the .cfg files) greyed out in the list.
I have a group of hosts that I have disabled checks on. However, they are still showing up under the ops center. When I cehck the host .cfg file, I see that they are, in fact, assigned to a host group.
If I go to that host group. via the GUI nothing is assigned.
It seems I'm in an endless loop?
I recreated all of the host groups and applied the configs. Things went fine.
However, now when I go to either the host or the host groups via the GUI, there are no hosts assigned to the host groups. I don't even have the hosts that SHOULD be assigned (and are per the .cfg files) greyed out in the list.
I have a group of hosts that I have disabled checks on. However, they are still showing up under the ops center. When I cehck the host .cfg file, I see that they are, in fact, assigned to a host group.
If I go to that host group. via the GUI nothing is assigned.
It seems I'm in an endless loop?