Check_tcp, how to?

icinga2

(Arethusa) #1

Hello,

I try to use the check_tcp like that:

apply Service "tcp" for ( tcp => config in host.vars.tcp ){
  import “generic-service”

  check_command = “tcp”
  var += config

  assign where host.address == "192.168.1.203"
}

and:

object Host "web" {
  importe "generic-host"
  address = "192.168.1.203"

  vars.tcp["80"] = {
	tcp_port = 80
	}
}

I follow the example from here: https://monitoring-portal.org/woltlab/index.php?thread/39855-how-to-apply-service-check-to-a-servicegroup-in-icinga2/

Maybe I forget a thing, or I do a mistake or syntax error ?

cause icinga2 say I have problem at:
"check_command = “tcp”
“var += config”

Thank you.


(Nicolai) #2

You forgot an s (vars += config)


(Arethusa) #3

-_-

Most fast and efficient answer for 2019.

15 min to right this, 20 seconds to have solutions.

you just humiliate me ^^

Thank you very much !


(Nicolai) #4

You’ re welcome :slight_smile: