Rename Host Group

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Rename Host Group

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Rename Host Group

Post 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:

Code: Select all

/usr/local/nagios/etc/static
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.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Rename Host Group

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Rename Host Group

Post by abrist »

What version of XI are you running?
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.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Rename Host Group

Post by asmgiadmin »

Nagios XI 2012R1.6 Copyright © 2008-2013 Nagios Enterprises, LLC.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Rename Host Group

Post by abrist »

Was this an upgrade from a previous version? If so, what version did you upgrade from?
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.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Rename Host Group

Post by asmgiadmin »

fresh install.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Rename Host Group

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Rename Host Group

Post by asmgiadmin »

thank you
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Rename Host Group

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked