Is there a way to automatically get data fields definitions for ITL commands?

Within the Icinga for Windows framework there is the Get-IcingaCheckCommandConfig command that provides a Director configuration basket that includes both CheckCommand definitions and all the data fields used by those commands.

For linux Icinga Agents, my Director is already aware of the CheckCommand definitions (they are imported as External Commands from the Icinga Template Library files on-disk on the icinga master node) but there are no Data Fields definitions for those commands.

Am I missing something here? Is there something somewhere to get data fields definitions for ITL commands automatically imported in the Director or should I configure them by myself even for standard check commands (ie. men, disk, load, procs, etc…) ?

thank you

Hi :slight_smile:

Simply run the Directors kickstart wizard /director/dashboard?name=infrastructure#!/director/kickstart against your config master. This will import the ITL definitions into the Director.
This also imports configuration stored under /etc/icinga2, so make sure you don’t have duplicates there and in the Director.

I did (re)run the kickstart but it only imported command definitions, not any data field.

To make a concrete example, after importing the Director config basket from IcingaForWindows, you can go to an host in director, select Services, and you get to override individual fields for that service on that host.

In the case of linux hosts with commands imported from the ITL, there are no fields to override for services on hosts/templates in my Director setup. I have to define my own data fields (eg. a mem_critical string field) and associate it with the command that was imported from ITL (eg. External Commands > mem > Fields > add the mem_critical field), or I need to create a Service Template and add fields on it without defining a custom data field (but then I loose type checking and other goodies). Only after having done one of the two previous actions I am able to manage/override that fields on templates and hosts.

Is this the way it is supposed to be used or there is something missing in my setup? Is there any way to automatically import and associate field definitions for ITL-provided commands that will get me to the end result of having pre-defined fields that can be defined and overridden on hosts and host templates?

do not import them as external commands. use the powershell command to get baskets and import it as a basket into director.

You are right, the kickstart does not automatically create the data fields. I misread your initial question.

To have the datafields you need to create them. But the Director will do most of the work for you.

Go to the command, switch to the “Fields” tab and add the fields/variables you want to use. For not yet created variables you will get a slightly modified dialogue, which will create the datafield while you add it.

This will work for all string and set_if arguments and create the according data field.
In case your argument expects an array (like with “repeat_key = true”) you will go to the data fields settings afterwards and change it to the array type manually.

@log1c yeah I know how to do that, I was looking for confirmation that there is not a predefined configuration basket that could be imported to avoid the process of manually defining fields. Thank you for clarifying this.
Yes the director helps in that regard by taking fields and their descriptions from the CheckCommand object :slight_smile:

@moreamazingnick we’re talking linux here, I’ve already done what you describe for the windows hosts where I’m using the Icinga For Windows framework.