NotificationCommand definition with env{} migrate to Icinga Director

We have configured some NotificationCommand at an other Icinga instance:

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.

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:

and here is a hacky workaround:

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 :grinning_face: