Variable Inheritance from Service-Sets

Hi,

when Service-Sets are created the values of a service are usually inherited to the single hosts the service is assigned to. Here for instnace the Portnumber: 25009. At least i would expect so.

When I view the same Service assigned to the hosts the portnumber is missing. However the check itself is executed correctly with the port 25009:
‘/usr/lib64/nagios/plugins/check_tcp’ ‘-H’ ‘’ ‘-M’ ‘warn’ ‘-p’ ‘25009’ ‘-r’ ‘crit’ ‘-t’ ‘10’
The Icinga-Director View of the Service is missing the number.

Is this an expected behaviour? I would expect that the field tcp_port value is transparently passed over to the service object assigned to the host.

I use following Pckgs:
icinga-director-daemon-1.11.5-1.el8.noarch
icinga-director-1.11.5-1.el8.noarch
icinga-php-library-0.17.0-1.el8.noarch
vim-icinga2-2.15.0-1.el8.x86_64
icingaweb2-2.12.5-1.el8.noarch
icingadb-web-1.2.2-1.el8.noarch
icinga-selinux-common-1.0.0-1.el8.icinga.noarch
icinga2-bin-2.15.0-1.el8.x86_64
icinga2-common-2.15.0-1.el8.x86_64
php-icinga-2.12.5-1.el8.noarch
icingadb-1.4.0-1.el8.x86_64
icinga-l10n-1.3.0-1.el8.noarch
icinga-director-php-1.11.5-1.el8.noarch
icinga-php-incubator-0.22.0-1.el8.noarch
icinga2-2.15.0-1.el8.x86_64
icinga2-selinux-2.15.0-1.el8.x86_64
icingaweb2-common-2.12.5-1.el8.noarch
icinga-director-web-1.11.5-1.el8.noarch
icinga-php-thirdparty-0.13.1-1.el8.noarch
icingadb-redis-7.2.10-1.el8.x86_64
icingacli-2.12.5-1.el8.noarch
icinga2-ido-mysql-2.15.0-1.el8.x86_64

Hello,

Could you share a printscreen of the “Preview” tab in “resolved” mode? The “Services” tab is probably not configured to show the correct custom properties.

Best regards

Jean

Hi, thank you for your help!
This is the Service-Set snippet for the 25009 TCP-Check:

apply Service "TCP Port - 25009 - AJP XXX" {
    import "Service TCP Port"

    assign where host.name == "<fqdn>" || host.name == "<fqdn>"
    vars.tcp_port = "25009"

    import DirectorOverrideTemplate
}

and here the Service-template the service in the service-set is importing.

Hi,

Thank you for this!

I think - to be confirmed by an expert - that you can have variables defined both at Service level (your case) and at Host level.

Icinga will try resolving the variable value (tcp_port in your case) first by looking at the closest object, then moving up. So in this case, tcp_port is being used by a Service object, is defined at Service level, and Icinga will use that value.

Now, your question is why Director doesn’t resolve the Service-level variable to show it in the Host definition. This would also need an expert to bring the answer.

What is really strange is that if your Service-level variable is defined within an imported Service Template, then the variable value does show in the Host window showing the Service…

Sorry not to be of more help…

Jean

Ok, thank you anyway!
But your custom variables defined in a service-set are resolved on host-level? I think it used to be resolved but I am not sure.