Change Host IP address to host name

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hlaten01
Posts: 15
Joined: Thu Feb 15, 2018 1:54 pm

Change Host IP address to host name

Post by hlaten01 »

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

Post by npolovenko »

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.
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
Other then that, the only solution is to manually change the hostadress fields for each host.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
hlaten01
Posts: 15
Joined: Thu Feb 15, 2018 1:54 pm

Re: Change Host IP address to host name

Post by hlaten01 »

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

Post by npolovenko »

@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.
Locked