Hello all,
im relative new to icinga2(working with it for about 3 days).
I am currently trying to check if the GUI of my switch is reacheable with https. It should only be recheable with https and not with http. Checking if the https version is reachable is relatively easy. But how do I alert as soon as the site is also reachable by http. I tried with the normal check_http but I have no clue how to “reverse” the check. So it only alerts if the connection goes UP. So Down=ok, UP=critical
apply Service "check_http" {
import "basic-http"
max_check_attempts = 5
check_interval = 5m
retry_interval = 60s
check_command = "http"
vars.http_ssl = false
assign where host.vars.kategorie == "xxxx" && host.vars.type == "xxxx"
}
Then I tried just to check if the port is listening with check_tcp.
I saw that there is a “tcp_refuse” in the documentation but this only states the refused connection with OK but doesn’t change when the port is UP, so it is always UP
apply Service "Tcp_80"{
import "basic-service"
check_command = "tcp"
vars.tcp_port = "80"
vars.tcp_refuse = "ok"
assign where host.vars.kategorie == "xxxx" && host.vars.type == "xxxx"
}
Help is much appreciated!