Page 1 of 1
Rename Host Group
Posted: Fri Mar 15, 2013 8:41 am
by asmgiadmin
I'd like to rename hostgroups, but have hostgroup defined in host.cfg files. So when current hostgroup is renamed, configuration throws error since host.cfg is configured with old-hostgroup-name.
I can script an update to all host.cfg containing old-hostgroup-name, but how can I incorporate update to play nicely with nagios configuration?
Re: Rename Host Group
Posted: Fri Mar 15, 2013 9:08 am
by slansing
If you did write a script to automatically update that line within the hosts.cfg file, you would need to place your configuration files in the following directory:
From there you can edit the configurations without them being overwritten by Nagios XI. They will be used by Nagios XI from that directory, but it is worth mentioning that you will need to then import those configuration files into Nagios XI if you want to access features which require them to be in the database such as managing them from the Core config manager, etc..
Additionally you could create a Host template and simply rename the Host Group listed in there when you change it's name, then all the hosts under that template will inherit that information.
Re: Rename Host Group
Posted: Fri Mar 15, 2013 9:10 am
by asmgiadmin
It looks like existing hosts have picked up new hostgroup rename. Browsing to host -> host groups shows updated name.
However, searching through /usr/local/nagios/etc/hosts/hostname.cfg files still shows old name - assuming because config has not sucessfully applied.
Auto config is failing with the following:
Code: Select all
Error: Could not find any hostgroup matching 'servers-windows-all' (config file '/usr/local/nagios/etc/hosts/host-not-in-ui.cfg', starting on line 14)
servers-windows-all is old hostgroup name.
host-not-in-ui does not appear in UI, but has .cfg file in /usr/local/nagios/etc/hosts
Please help explain how hosts can be removed from UI but still reside in /usr/local/nagios/etc/hosts and how to best correct this issue.
Re: Rename Host Group
Posted: Fri Mar 15, 2013 10:42 am
by abrist
What version of XI are you running?
Re: Rename Host Group
Posted: Fri Mar 15, 2013 10:44 am
by asmgiadmin
Nagios XI 2012R1.6 Copyright © 2008-2013 Nagios Enterprises, LLC.
Re: Rename Host Group
Posted: Fri Mar 15, 2013 10:56 am
by abrist
Was this an upgrade from a previous version? If so, what version did you upgrade from?
Re: Rename Host Group
Posted: Fri Mar 15, 2013 10:58 am
by asmgiadmin
fresh install.
Re: Rename Host Group
Posted: Fri Mar 15, 2013 1:36 pm
by scottwilkerson
asmgiadmin wrote:Please help explain how hosts can be removed from UI but still reside in /usr/local/nagios/etc/hosts and how to best correct this issue.
Probably the easiest way to remedy the situation would be to run the following
Code: Select all
rm -rf /usr/local/nagios/etc/hosts
rm -rf /usr/local/nagios/etc/services
Then go to CCM-> Write config Files
Write
Verify
If no errors
Restart
Re: Rename Host Group
Posted: Fri Mar 15, 2013 1:45 pm
by asmgiadmin
thank you
Re: Rename Host Group
Posted: Fri Mar 15, 2013 1:50 pm
by sreinhardt
You are welcome, please let us know if there are further issues with it, I will leave the topic open for a little while.