Hostname change on Icinga Server


(Gergo Schwahofer) #1

Hello,

We changed the hostname of our Icinga Server.

Which files should we edit to make it work again with webgui and director?

We changed the hostname and Fully qualified name too, and ran the Wizard Script and API wizard too, all of them checked for the hostname and changed it, we also created the new certificate with the wizards but still not working.

There was a command I cant remember getting the Node Name and its still saying the old hostname, but all the other commands and showing the new one , like hostname, host etc…

Please try to help in our case.

Thanks


(Matthias) #2

Have you checked constants.conf?


(Gergo Schwahofer) #3

Sure. new Hostname is there. Also checked zones.conf, now we are trying to change all the director mysql db inputs where is the old hostname written to changing to the new one.


(Rafael Voss) #4

HI,

what is not working ? The Checks ? Zone Connections ? Director Config export ? Icingaweb 2 itself ?


(Gergo Schwahofer) #5

Hallo,

Icinga started, thats works now after I changed every old hostname inside the Director MYSQL DB.

Now icingaweb2 not connected somehow to the Icinga.


(Michael Friedrich) #6

Seems that Icinga Web 2 lost its configuration in /etc/icingaweb2.


(Gergo Schwahofer) #7

Hello Michael,

I checked that too, everything is the same like on the other Server. I created a snapshot from the old one so we can see everything what changed or not. Every Configuration and files is the same in /etc/icingaweb2. The old is working perfectly after the snapshot installed to a Virtual Machine. The new one have the problem I screenshoted above. Any other idea? Thank you.


(Michael Friedrich) #8

SELinux? File permissions? Anything in the Icinga Web 2 / webserver log?


(Gergo Schwahofer) #9

I just totally cloned a Debian Server and changed the hostname. Deleted the entries from Director DB and changed the constant conf thats all. Permission , and everything is the same.


(Rafael Voss) #10

If you change things in the directorDB that should not have any impact on icinga, until you deploy the config. Have you deployed the config after it, without using the director webgui, because its not working ?

I would start over again and first try if anything is working. You don’t need to change the constants and zone configs first, as that infomation does not need to fit the hostname (so you also can skip certificate recreation). The important part is the “host =” part of the endpoint: Change the hostname (if its there) to the ip address and it should work.

If that is working you can start changing things step by step.


(James Y) #11

Thanks for the website.
I recently had to change the hostname on my server as well. I’m not running director, just a simple setup, Ubuntu 16.04 & MySQL with a dozen or so servers, and few hundred hostalive targets. But I was getting some strange errors after running the “icinga2 daemon -C” command. After working thru those errors, I had to change the name in the certs folder here “/var/lib/icinga2/certs/” to match the new host name. Also had to change the constant.conf variable for NodeName, but not for Zone name.

thanks for the awesome product, and a good site for support.