How to add custom vars while creating a command

  • Director version (System - About): 1.7.2
  • Icinga Web 2 version and modules (System - About): 2.8.2
  • Icinga 2 version (icinga2 --version):2.12.4-1
  • Operating System and version: RHEL 8.4 4.18.0-305.19.1.el8_4.x86_64
  • Webserver, PHP versions: Apache 2.4.37-39 , PHP 7.2.24

I am trying to create a couple of new notification commands (to be exact I am trying to add the PagerDuty commands so I can use them the same way as mail-host-notification and mail-service-notification under Icinga Director. This is the conf file:

If I were to create a new command under Icinga Director, how do I add vars similar to vars.notification_address, vars.notification_address6, etc defined in mail-host-notification?

In the PagerDuty case, how could I get
vars.f_args = [

added to the command?

create a datafield in icingaweb2/director/define data field → name =f_args type=array
add this data field as a field to the command
click on command you will see the field f_args
put in each line without the " "
the preview will show you something like this:

object CheckCommand "test" {
    import "plugin-check-command"
    command = [ PluginDir + "/dummy" ]
    vars.f_args = [ "SERVICEDESC=$$", "HOSTSTATE=$host.state$" ]