# NotificationCommand definition with env{} migrate to Icinga Director

**URL:** <https://community.icinga.com/t/notificationcommand-definition-with-env-migrate-to-icinga-director/15580>\
**Category:** Automation & Infrastructure\
**Tags:** director\
**Created:** [September 15, 2026, 2:37pm UTC](https://community.icinga.com/t/notificationcommand-definition-with-env-migrate-to-icinga-director/15580 "2026-09-15T14:37:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KlStz](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@KlStz](https://community.icinga.com/u/KlStz)\
**Post date:** [September 15, 2026, 2:37pm UTC](https://community.icinga.com/t/notificationcommand-definition-with-env-migrate-to-icinga-director/15580/1 "2026-09-15T14:37:12Z")

</div>

We have configured some NotificationCommand at an other Icinga instance:

```auto
object NotificationCommand "mattermost-host-notification" {
...
  env = {

  ...

  HOSTSTATE = "$host.state$"

  }
... script....
}

```

I want configure it at Icinga Director and I can use the script in the same way.

It’s possible - I don’t know ?

Perhaps with Arguments =\> Condition format =\> Icinga DSL - that could work. But I don’t have any experiences.

Otherwise I have to extend the script with parameter parsing.

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [September 15, 2026, 2:46pm UTC](https://community.icinga.com/t/notificationcommand-definition-with-env-migrate-to-icinga-director/15580/2 "2026-09-15T14:46:24Z")

</div>

Icinga Director can’t use env vars.

You can use the command natively in icinga and import it using director kickstarter.  
The imported command can be used in icingadirector as external command but is not editable.

here is a post about env vars, I think this is natively used and imported:

> [@Env variables are being taken in count?](https://community.icinga.com/t/env-variables-are-being-taken-in-count/11063):
>
> I’m trying to use a telegram notification script I found here ([GitHub - TeraIT-at/icinga-telegram-bot: Telegram Bot for Icinga2](https://github.com/TeraIT-at/icinga-telegram-bot)) For the notification definition it uses env variables and it’s defined as follows: object NotificationCommand "telegram-host-notification" { import "plugin-notification-command" command = [SysconfDir + "/icinga2/scripts/telegram-host-notification.sh"] env = { NOTIFICATIONTYPE = "$notification.type$" HOSTNAME = "$host.name$" HOSTALIAS = "$host.di…

and here is a hacky workaround:

> [@Rocket.Chat notification help](https://community.icinga.com/t/rocket-chat-notification-help/10243/8):
>
> try to run the go command manually (from shell) first, so we can exclude any configuration issues on the rocketchat side

---

<div class="post-metadata">

**Author:** ![KlStz](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@KlStz](https://community.icinga.com/u/KlStz)\
**Post date:** [September 16, 2026, 8:23am UTC](https://community.icinga.com/t/notificationcommand-definition-with-env-migrate-to-icinga-director/15580/3 "2026-09-16T08:23:18Z")

</div>

Thanks.

It’s a little bit confusing. The icinga2 daemon reads the NotificationCommand from filesystem (see above). The Director kickstarter read it also and it’s listet at “External Commands” - that’s right. But the definition shown ist:

`object NotificationCommand "mattermost-host-notification" {`  
` import "plugin-notification-command"`  
` command = [`  
` "/etc/icinga2/scripts/mattermost-host-notification.sh"`  
` ]`  
` timeout = 1m`  
`}`

The director’s notification configuration is running.

SUCCESS 😀
