Array in customvars not getting for notification command not being taken as an array

Hi all,

I’ve been trying to implement pagerduty integration into our icinga2/director but I am having difficulty in getting it working. The documentation for pagerduty has a config file that is to be used as additional configuration in /etc/icinga2 but I would rather have it setup with director instead.

Where I am getting stuck is at getting the array as a custom vars for the notification command.

The documentation shows the output should be:

  vars.f_args = [
    "SERVICEDESC=$service.name$",
    "SERVICEDISPLAYNAME=$service.display_name$",
    "HOSTNAME=$host.name$",
    "HOSTSTATE=$host.state$",
    "HOSTDISPLAYNAME=$host.display_name$",
    "SERVICESTATE=$service.state$",
    "SERVICEPROBLEMID=$service.state_id$",
    "SERVICEOUTPUT=$service.output$"
  ]

However in when I try to add the array in Director the preview tab shows the following:

      vars.pd_f_args_service = [
        "\"SERVICEDESC=$service.name$\", \"SERVICEDISPLAYNAME=$service.display_name$\", \"HOSTNAME=$host.name$\", \"HOSTSTATE=$host.state$\", \"HOSTDISPLAYNAME=$host.display_name$\", \"SERVICESTATE=$service.state$\", \"SERVICEPROBLEMID=$service.state_id$\", \"SERVICEOUTPUT=$service.output$\""
    ]

For some reason, it looks like it is adding quotes around the array and I suspect that is why it cannot then read the array but it reads it as a string.

my pd_f_args_service datafield is setup with datatype Array, so I’m not sure what’s going on.

Is this a bug? any help or insight would be appreciated

thanks to all.

It looks like you are running into this topic.

Hi, thank you for pointing it out, during my troubleshooting I had read that thread but even rereading it now, I’m not sure I understand what and how it’s relevant to what I am experiencing. Does that mean that Director doesn’t support having and array inside another array and that the only way for me to get this to work is to add each field individually? if so, why would it be an option to repeat the key in the arguments tab of a notification command?

How can I make use of the repeat key in that case?