Hi, am somewhat a newb to icinga2 so this is probably a configuration issue. Can’t seem to find anyone else that has had this issue though. After a clean install of icinga2 and icinga2web on CentOS, everything looks good. Can see all my hosts and services, all is green. I want this install to be my Master, so I run the icinga2 node wizard. After I run the wizard and restart icinga2 all my hosts and services disappear. I see them in my etc/icinag2/conf.d/hosts.conf file, but nothing on the web page.
On the node setup wizard I answered the questions as follows:
Please specify if this is a satellite/client setup (‘n’ installs a master setup) [Y/n]: n
Please specify the common name (CN) [icinga2-master1.mydomain.com]:
Master zone name [master]:
Do you want to specify additional global zones? [y/N]: N
Please specify the API bind host/port (optional):
Bind Host []:
Bind Port []:
Do you want to disable the inclusion of the conf.d directory [Y/n]:
Disabling the inclusion of the conf.d directory…
Checking if the api-users.conf file exists…
Done.
At this point all my hosts/endpoints are switches and routers. Just doing simple snmp and hostalive checks. Do I need to change the entries in my hosts.conf and services.conf to make them visible again?
Do you want to disable the inclusion of the conf.d directory
So the default was Y, I don’t see a “no” specified. If your hosts/services are in conf.d, you’ll want to edit icinga2.conf to re-include that directory. That particular question is for when you’re setting up something with master and satellite zones in zones.d and don’t want conf.d conflicting. Were you planning on satellite zones, or is it just the one server you’re working with here?
Hi Blake, right now I just want one main server. In the future I may have satellite zones (ie some branches that connect to HQ). Want to keep it simple at first until I am better acquainted with the software and know what I am doing. I believe I just hit enter and accepted the default for that last question.
Thanks. That worked. After I uncommented that, icinga2 would not restart. Threw the error:
critical/config: Error: Object ‘root’ of type ‘ApiUser’ re-defined: in /etc/icinga2/conf.d/api-users.conf: 4:1-4:21; previous definition: in /etc/icinga2/conf.d/api-users.conf: 4:1-4:21
So it looks like the wizard also uncommented the line:
include “conf.d/api-users.conf”
Once I commented that line out. I was able to restart and everything came back. That is a little confusing to me. If that line is commented out how is icinga getting in info it needs for api connections?
Sorry, think I miss communicated. Everything is working now. I was just trying to understand why I had to comment out the line:
include “conf.d/api-users.conf”
I would think that file is necessary for api connections to work.
The duplicate actually makes sense to me now. Since you’re including conf.d recursively, you are thereby including api-users.conf. Explicitly telling it to include it again caused the redefine error.