Change Host IP address to host name
Change Host IP address to host name
I am looking for help, hopefully a script, on changing the Host IP address that is located for each device in host management to the host name which is the fqdn of each device, thus not using the IP address in the address label. This will help in each server not having to have it's IP address changed during our Greenfield move or if we change IP addresses on a device and we then can be a truly use DNS for our monitoring. Running Nagios XI from OVA file to VMWare. Nagios XI 5.5.7.
You do not have the required permissions to view the files attached to this post.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Change Host IP address to host name
Hello, @hlaten01. We don't have a script to automate this process. How many hosts are you looking to modify?
You could write our own script that takes care of that or contact the sales departmement to get a quote for a custom developement. The order of changing the configs would probably look like this.
You could write our own script that takes care of that or contact the sales departmement to get a quote for a custom developement. The order of changing the configs would probably look like this.
Other then that, the only solution is to manually change the hostadress fields for each host.mkdir /backup
cp /usr/local/nagios/etc/hosts/* /backup
cp /usr/local/nagios/etc/hosts/* /usr/local/nagios/etc/import/
**Your script replaces all hostaddress fields with hostname fields in all host configs in the /usr/local/nagios/etc/import/ folder.
cd /usr/local/nagiosxi/scripts/
./reconfigure_nagios.sh
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Change Host IP address to host name
Thank you for the information. Weird that this has not been ask yet by anyone else under support contract. I have right at 450 host that need to be converted.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Change Host IP address to host name
@hlaten01, Actually, try changing the host check command to use the $HOSTNAME$ instead of $HOSTADDRESS$. Go to commands, find the command that is used for all host checks and replace the macro.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.