Include under "apply"

Hi,

In our apply Service, I’m always having the same block that contain an IF / ELSEIF / ELSE with over 10lines…

Is there something in icinga that I can just put our block in a file and under all apply Service I can do something like an include ?

Hello @PointPubMedia!

Sure:

template Service "t" {
  vars.foo += 2
}

apply Service "a" {
  vars.foo = 1
  import "t"
  log(vars.foo)
}

Best,
AK

1 Like