Page 1 of 1

Renaming a parent host

Posted: Wed Jan 10, 2018 11:34 am
by msoo
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!

Re: Renaming a parent host

Posted: Wed Jan 10, 2018 4:31 pm
by npolovenko
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.