Renaming a parent host

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
msoo
Posts: 1
Joined: Wed Jan 10, 2018 11:29 am

Renaming a parent host

Post 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!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Renaming a parent host

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked