Director: No Master and icinga_master set?


I have setup Icinga2, Icingaweb2, icingadirector and graphite/grafana on the same host.

This works. But now i have two questions:
is it correct, that I don’t find my master in icingaweb – Icinga-Director – Hosts? So I can’t add any new service for my master?

In graphana for a dashboard i find the variable $icinga_master. Do you know where I find this to set? Grafana find my master and my Host, but not when I use $icinga_master


The master is either listed as “localhost” or with the device internal IP.
if you are unsure if it is defined, run in the CLI

icinga2 daemon -C

That should give you a list of all the object (summed) you have defined and if there is an issue in any part of the configuration it will indicate to it.


Thank you. Sorry I’m not completly sure if you meean the command for the variable or for my question why I don’t see the Master under Icinga-Director. So I try to write the answer.

Under Icingaweb2 --> Icinga-Director --> Hosts I have only my added host and not my Master.
Under Icingaweb2 --> Overview and hosts I find my master.

With icinga2 daemon -C i don’t see the icinga_master

icinga2 daemon -C
[2020-02-26 08:24:50 +0100] information/cli: Icinga application loader (version: v2.11.2-521-g099cc5d8d)
[2020-02-26 08:24:50 +0100] information/cli: Loading configuration file(s).
[2020-02-26 08:24:50 +0100] information/ConfigItem: Committing config item(s).
[2020-02-26 08:24:50 +0100] information/ApiListener: My API identity: MONITOR.mydomain.local
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 GraphiteWriter.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 NotificationComponent.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 2 Hosts.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 2 NotificationCommands.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 13 Notifications.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 2 HostGroups.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 Downtime.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 ApiListener.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 FileLogger.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 4 Zones.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 2 Endpoints.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 ApiUser.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 User.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 236 CheckCommands.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 UserGroup.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 3 ServiceGroups.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 3 TimePeriods.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2020-02-26 08:24:50 +0100] information/ConfigItem: Instantiated 17 Services.
[2020-02-26 08:24:50 +0100] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2020-02-26 08:24:50 +0100] information/cli: Finished validating the configuration file(s).

Most properly you have included conf.d during icinga2 node wizard that’s why your master is visible under Overview but not Director.

1 Like

@rsx you mean the File /etc/icinga2/conf.d/hosts.conf? This is with the default settings and not with the host Name. Givs a way to add this in the director with the exists services?

Yes, these conf files are just examples and it’s recommended to not use them especially if you use the director.

To fix it just remove or comment out

include_recursive “conf.d”

in your /etc/icinga2/icinga2.conf, reload icinga2 and then start adding your master to the director as well as the services. Please keep in mind that you should not configure services for every single hosts (as in Nagios/Icinga 1) but use the apply concept instead.

@rsx great. Only that i understand.
When i comment out, my hosts is not listet longer. Now I must add the host manually and add all the services manually in director? That is no problem.
EDIT: Sorry I don’t have see the the second part. You have answered this. :slight_smile: Thank you

Do you have an idea for the variable $icinga_master from grafite where I can set this?

No, I’m sorry, I don’t use graphite but grafana.

@rsx sorry my fail. I mean grafana. When I go to grafana and import the dashboard 5009, there is a variable $icinga_master. But this don’t work. I must change the value with my master host. So i had the hope that I can set this variable $icinga_master

I don’t know about dashboard 5009 and $icinga_master. I’m using influxdb and this dashboard.

@rsx thank you.

One question for add the new Host (Icinga 2 Master). When I comment out and insert the new host, I get the error “Unable to detect your Icinga 2 Core version” on push my changes

You’re welcome.

I’ve never been seeing this error, could please run icinga2 daemon -C and share the output if it fails?

yes :slightly_smiling_face:
I have comment out the line and restart icinga. Now my Icinga2 Master is not longer listet in the Overview.

After this. I go to Icinga Direcetor and add Host wit my dns name. After this a roll out my changes. Now I get this error

One question for add the new Host (Icinga 2 Master).

With icinga2 daemon -C I geht two warnings, but I don’t know why the service is not ok.

[2020-02-26 10:49:35 +0100] warning/ApplyRule: Apply rule 'Service - Icinga 2 Server - Hostalive' (in /var/lib/icinga2/api/packages/director/2c544f07-bd74-4a39-963c-c6c9ae58f512/zones.d/director-global/service_apply.conf: 1:0-1:52) for type 'Service' does not match anywhere!
[2020-02-26 10:49:35 +0100] warning/ApplyRule: Apply rule 'Service - Icinga 2 Server - Ping 4' (in /var/lib/icinga2/api/packages/director/2c544f07-bd74-4a39-963c-c6c9ae58f512/zones.d/director-global/service_apply.conf: 12:1-12:50) for type 'Service' does not match anywhere!

No this is just a warning that these services are not applied to any host. Means your apply rules find no targets.

I don’t get more error

icinga2 daemon -C
[2020-02-26 10:58:02 +0100] information/cli: Icinga application loader (version: v2.11.2-521-g099cc5d8d)
[2020-02-26 10:58:02 +0100] information/cli: Loading configuration file(s).
[2020-02-26 10:58:02 +0100] information/ConfigItem: Committing config item(s).
[2020-02-26 10:58:02 +0100] information/ApiListener: My API identity: MONITOR.domain.local
[2020-02-26 10:58:02 +0100] warning/ApplyRule: Apply rule 'Service - Icinga 2 Server - Ping 4' (in /var/lib/icinga2/api/packages/director/0dc893f2-2d01-4f39-8a8a-09dd62cdca19/zones.d/director-global/service_apply.conf: 1:0-1:49) for type 'Service' does not match anywhere!
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 NotificationComponent.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 Host.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 ApiListener.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 FileLogger.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 4 Zones.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 2 Endpoints.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 236 CheckCommands.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 1 ServiceGroup.
[2020-02-26 10:58:02 +0100] information/ConfigItem: Instantiated 4 Services.
[2020-02-26 10:58:02 +0100] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2020-02-26 10:58:02 +0100] information/cli: Finished validating the configuration file(s).

Here is described the same error. Can you check your environment accordingly?

Another idea is an error with your zones.conf. Could you please share it?

object Endpoint NodeName {
  host = NodeName

object Zone ZoneName {
  endpoints = [ NodeName ]

object Zone "global-templates" {
  global = true

object Zone "director-global" {
  global = true

I can try to reinstall the system (It is only a dev setting) and comment out the include_recursive before I install the director.

I think the hostfile is ok. I have try to remove the dns name of server and set up the ipv4 from network but allways the same error

Does your constants.conf contain valid NodeName and ZoneName?

@rsx Thank you for all help

I have reinstall, and have uncomment the conf files before I have installed the director. Now it works.

I geht in icingaweb2 under Icinga Director this hint:
Your DB schema (migration #170) is newer than your code base. Downgrading Icinga Director is not supported and might lead to unexpected problems.

I think this is only a information and can be ignored, or givs a change to disable this?

Oh, this is bad. I’d assume you’ve used at some time the director master branch but not a released version. This should never be done.

To fix it I’d recommend to delete your current director database and re-create it.