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.