# Variable Inheritance from Service-Sets

**URL:** <https://community.icinga.com/t/variable-inheritance-from-service-sets/15122>\
**Category:** Icinga Director\
**Created:** [September 3, 2025, 11:04am UTC](https://community.icinga.com/t/variable-inheritance-from-service-sets/15122 "2025-09-03T11:04:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leziri](https://community.icinga.com/letter_avatar_proxy/v4/letter/l/a9adbd/32.png) [@leziri](https://community.icinga.com/u/leziri)\
**Post date:** [September 3, 2025, 11:04am UTC](https://community.icinga.com/t/variable-inheritance-from-service-sets/15122/1 "2025-09-03T11:04:13Z")

</div>

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.

 ![image](https://community.icinga.com/uploads/default/original/2X/c/c2ecd59d771742fbf84db81002b5d62cc2eae4b2.png)

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.

 ![image](https://community.icinga.com/uploads/default/original/2X/5/5b61fdcfb6639a30d2bdebdf74b813e652add215.png)

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

---

<div class="post-metadata">

**Author:** ![jeanm](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/6a8cbe/32.png) [@jeanm](https://community.icinga.com/u/jeanm)\
**Post date:** [September 3, 2025, 11:55am UTC](https://community.icinga.com/t/variable-inheritance-from-service-sets/15122/2 "2025-09-03T11:55:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leziri](https://community.icinga.com/letter_avatar_proxy/v4/letter/l/a9adbd/32.png) [@leziri](https://community.icinga.com/u/leziri)\
**Post date:** [September 3, 2025, 12:04pm UTC](https://community.icinga.com/t/variable-inheritance-from-service-sets/15122/3 "2025-09-03T12:04:41Z")

</div>

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

```auto
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.

 ![image](https://community.icinga.com/uploads/default/original/2X/7/7ccb4060d09e3c776ba3e0442db3f176bcd99650.png)

---

<div class="post-metadata">

**Author:** ![jeanm](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/6a8cbe/32.png) [@jeanm](https://community.icinga.com/u/jeanm)\
**Post date:** [September 3, 2025, 12:55pm UTC](https://community.icinga.com/t/variable-inheritance-from-service-sets/15122/4 "2025-09-03T12:55:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leziri](https://community.icinga.com/letter_avatar_proxy/v4/letter/l/a9adbd/32.png) [@leziri](https://community.icinga.com/u/leziri)\
**Post date:** [September 3, 2025, 1:20pm UTC](https://community.icinga.com/t/variable-inheritance-from-service-sets/15122/5 "2025-09-03T13:20:11Z")

</div>

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.
