Renaming a parent host

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Renaming a parent host

Postby msoo » Wed Jan 10, 2018 11:34 am

Hi all,
I am trying to rename a parent host who has a lot of children and trying to find a better way than going to each child and changing the parent name.
I thought about using find/replace using sed -i 's/OldName/NewName/g' but not sure if that's ideal in this situation.
Any suggestions?
Thanks!
msoo
 
Posts: 1
Joined: Wed Jan 10, 2018 11:29 am

Re: Renaming a parent host

Postby npolovenko » Wed Jan 10, 2018 4:31 pm

Hello, @msoo. Nagios Core doesn't have a Bulk Modifications Tool like XI, so using a sed command sounds reasonable.
Code: Select all
sed -i 's/OldName/NewName/g' config.cfg config2.cfg

I'd just suggest to backup the /etc/ folder so you could revert back if something goes wrong.
Otherwise, many text developers support string replacement, so you could use that as an option.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1684
Joined: Mon May 15, 2017 5:00 pm


Return to Nagios Core

Who is online

Users browsing this forum: npolovenko, yonorri and 27 guests