On 2014-09-29 14:15 (Mon), Kasia Macias wrote:
Maybe using "apply" keyword would be more convenient?
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#using-apply-services

I've tried to follow it, but Icinga2 refuses to start.

My host definition:

object Host "server1.example.com" {
  import "generic-host"

  address = "server1.example.com"

  vars.nrpe = "1"  # <------ added this variable
  vars.os = "Linux"
  vars.sla = "24x7"
}


My service definition:

object Service "disk_nrpe" {
  import "generic-service"

  host_name = "aww01.timedoctorstaging.com"

  check_command = "nrpe"
  vars.nrpe_command = "check_disk"
  vars.sla = "24x7"

  assign where host.vars.nrpe == "1"  # <------ added this line
# assign where "1" in host.vars.nrpe # <---- tried also this way, also errors
}


In the log, I can see:

[2014-09-29 14:58:22 +0000] critical/config: Location:
/etc/icinga2/conf.d/hosts/server1.example.com/disk.conf(5):  */
/etc/icinga2/conf.d/hosts/server1.example.com/disk.conf(6):
/etc/icinga2/conf.d/hosts/server1.example.com/disk.conf(7): object Service "disk_nrpe" { ^^^^^^^^^^^^^^ /etc/icinga2/conf.d/hosts/server1.example.com/disk.conf(8): import "generic-service"
/etc/icinga2/conf.d/hosts/server1.example.com/disk.conf(9):

Config error:
[2014-09-29 14:58:22 +0000] critical/config: 1 errors, 0 warnings.


The error goes away if I remove the "assign" line added to service definition.

What am I doing wrong?

--
Tomasz Chmielewski
http://www.sslrack.com


_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to