Director vs. conf files

Quick question. I had used Nagios several years ago, and I vaguely remember how to configure it using the *.conf files. I have now installed Icinga using the Director. Peeking at the conf files, it seems to me that Director stores its info somewhere else. I have the following questions:

  • I deduce that I should decide: either edit the conf files or use the director, but not both. Am I right?
  • If so, I will rather edit the conf files (which I can largely automate). But does the Director store its stuff? I would now need to merge the two.
  • related to that: do I need to uninstall, or somehow inactivate, the director? It seems to me that Icinga is ignoring the stuff that is in the *.conf files, after having been set up by the Director (but I may be wrong, I haven’t investigated this in detail).

many thanks for your help with these rather basic questions!

Someone may have more details, but basically Director stores the configurations in the database and generates the config files on-demand (when you deploy). They are written out locally that you can see in Icinga Director > Deployments.

1 Like

ahhh, now I am starting to believe that there is something wrong with the installation. The Director shows the correct files, but they don’t seem to get deployed. The directory “/etc/icinga2/zones.d” is empty, even after deployment. In fact, the deployment does not seem to work, I get a “sandclock” image circling around infinitely (see pic)

could the non-deployment be a permissions issue? Here are the permissions of the icinga2 folder, are they right?
drwxr-x— 2 nagios nagios 4096 Dez 9 19:35 conf.d
-rw-r–r-- 1 nagios nagios 993 Dez 8 21:57 constants.conf
-rw-r----- 1 nagios nagios 998 Dez 8 21:57 constants.conf.orig
drwxr-x— 2 nagios nagios 4096 Dez 8 21:52 features-available
drwxr-x— 2 nagios nagios 4096 Dez 8 21:57 features-enabled
-rw-r----- 1 nagios nagios 1721 Dez 16 2020 icinga2.conf
drwx------ 2 nagios nagios 4096 Dez 16 2020 pki
drwxr-xr-x 2 root root 4096 Dez 8 21:45 scripts
-rw-r----- 1 nagios nagios 1334 Dez 16 2020 zones.conf
drwxr-x— 2 nagios nagios 4096 Dez 15 21:02 zones.d

It may depend on your distro, but mine (CentOS 7) has a user icinga. (It may also help to format your posts to make them easier to read.)

The Director-written configs are under /var/lib/icinga2/api/packages/director/, if you want to dig around a little. Search directories named zones.d; my Director uses director-global.

My guess would be the Director daemon is not running. Background Daemon - Icinga Director

The daemon is used in current versions to fetch the answer of Icinga 2 after it has send the rendered configuration to the API endpoint.

And the location mentioned is correct, but just to add another detail: The API endpoint uses some kind of versioning, so you will find there different stages and some configuration which tells the system which one is the currently active stage.

But there is typically no need to dig there for an answer if you only use the Director (and zones.conf and constants.conf) as you can find the rendered configuration also in the UI next to the deployments.


@dgoetz : You, Sir, are a genius! I started the daemon, and now everything works!!!

Just to add a little on the conf files vs. Director point

You can use both. And will have to if you need more advanced configs which the Director can’t provide, e.g. setting variable values based on calculations or functions.
This generally is no problem.
Just keep in mind that

  • the objects from config files are not visible/editable inside the Director.
  • if you create equally named objects in the conf files and the Director neither will warn you about the duplicate until you try to render the config.

If mixing both and you added/changed something in the config files it is best to check the config first before deploying: icinga2 daemon -C

1 Like

I keep all assets descriptors (DHCP assignments, DNS names, locations) into a MS-SQL database. I have written a script which generates Nagios configs (and also DHCP and DNS tables) therefrom. I am now wondering whether the script could instead directly update the Director database tables. In this scenario, Director and configs would stay synchronized, right? Is that a stupid/dangerous thing to do?


the import menue has a function which helps you to directly access a database:whithout a script

You have only to configure a new database at the ressources menue from icingaweb

Works very well. But I had the experience that it works not very well with DB2 e.g.

1 Like

You should never directly modify director’s database but use director’s RestAPI.

In your case I’d create conf files directly from your database. I don’t see much advantages using director. And with conf files you don’t run into limitations of the director.

1 Like

To reply indirectly to the previous poster and “log1c” some plusses for using Director:

  • With its forms, Director steers a team of configurers to set up things the same way, mostly; config. files offer a lot more freedom to configure however the hell people want to. :wink:
  • It also disciplines configurers in the usage of apply rules.
  • Director offers a clear log of all changes, and easy methods to do roll-backs of the config’s at a later time.
  • With special features like service sets, & corresponding blacklisting functions, Director makes “universal” implementation of services assignments to hosts more transparent/easy.
  • The API, together with the icingacli director command features, make automation / metadata-transfer scripts easier to set up in our (humble?) opinion.

Basically, if your team of configurers has more than 2 members, or if your team is handling more than about 10 Icinga-using customers, Director is a pretty useful tool. One does hope that its functionality does keep moving closer to all that config. files can do… :slight_smile: