There are a number of options, my least favorite to advise is to install Nagios into a different location. It’s faster for sure, but there are a lot of things you need to do at build time, it might not be as simple as changing the prefix… and if mess up, it’l likely be the one installed.
Perhaps when you install your new Nagios you would like to try and install it into version-ed paths to start with, so next time you can just jump directly into installing the next Nagios into version-ed paths. Enter the how many versions of Nagios can you run at the same time contest!!!
So then how you ask?
I’d move the existing Nagios’ files out of the way for the new install. This way when you are done the new Nagios will be in it’s default location. Nagios has several folders in various locations /etc /usr(sub locations here) /var.
Take each folder contaning files for Nagios and move it, then make a link so nothing changes. Like so:
cd /…; # So you are in the folder of the folder you’d like to move.
Then use the folder’s Name, not it’s path.
a=; b=; mv $a $b && ln -s $b $a;
After this you just need to update all the configurations and path names from the old location to the new. You can remove and recreate it if anything goes wrong. After your all done and all the s have been removed and there are no bugs, then you can install Nagios and run your new Nagios.