Change Nodename

Hi,

i’v just installed the recent version on raspbian buster. Now i’m trying to install director and noted that i forget to configure the FQDN properly before installing icinga.
So i fixed it editing /etc/hosts
Now hostname --fqdn shows the result as it should.
Next i edit /etc/icinga2/constants.conf and changed the nodename also the the FQDN.

As found on the forum i ran icinga2 daemon -C which throws some errors because i cannot find the certificates. Sounds logic to me.
BUT executing icinga2 api setup doesn’t create new ones, it falls back to just the hostname instead of FQDN.

It might be an issue with my hosts file. it looks weird but only this configuration was able to get the command hostname --fqdn to work properly

127.0.0.1 server.domain.tld server localhost
127.0.1.1 server.domain.tld server
10.1.1.1 server.domain.tld server

Any ideas what i could do?

Edit:
I found https://github.com/Icinga/icinga2/issues/6649
the last post says
rm /var/lib/icinga2/ca/*
rm /var/lib/icinga2/certs/*
rm /var/cache/icinga2/*
icinga2 api setup

this worked in my case too. Is it possible that icinga2 api setup reads some old hostname values from /var/cache/icinga2 ?

1 Like

Hi, that was exactly I was looking for right now. For me, deleting the files and running icinga2 api setup again worked, too. After doing that I’ve had a look into the Github issue and maybe there’s another (easier?) way for this:

vi /etc/icinga2/constants.conf
icinga2 feature disable api
icinga2 daemon -C
icinga2 api setup

Source: https://github.com/Icinga/icinga2/issues/6649#issuecomment-638330961

Maybe that answers your question that running the setup reads “old” values if you don’t call the validate function (-C) before.

Regards,
Bernd