![Icinga2 원격 적절한 검사가 마스터의 결과를 표시하는 이유는 무엇입니까?](https://rvso.com/image/726820/Icinga2%20%EC%9B%90%EA%B2%A9%20%EC%A0%81%EC%A0%88%ED%95%9C%20%EA%B2%80%EC%82%AC%EA%B0%80%20%EB%A7%88%EC%8A%A4%ED%84%B0%EC%9D%98%20%EA%B2%B0%EA%B3%BC%EB%A5%BC%20%ED%91%9C%EC%8B%9C%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
네이티브 에이전트를 사용하여 일부 데비안 호스트를 모니터링하는 icinga2 설치가 있습니다.
를 제외한 모든 검사가 정상적으로 작동합니다 apt
. 표시된 결과는 icinga2 마스터 시스템에서 가져온 것이며 그 이유를 이해할 수 없습니다.
이것은 내 apt
서비스 구성입니다.
apply Service "apt" {
import "generic-service"
check_command = "apt"
assign where (host.name == NodeName || host.vars.linux_ver == "debian")
// assign where host.name == NodeName
}
힌트가 있나요?
답변1
질문은 오래되었지만 어떤 방식으로든 원격 클라이언트(command_endpoint)를 정의해야 합니다. 그렇지 않으면 마스터만 확인합니다. 에이전트 구성이 실행 중이라고 가정하므로 이미 zones.conf
. 원격 클라이언트를 위한 두 번째 서비스를 추가하는 것이 좋습니다.
apply Service "apt2" {
import "generic-service"
check_interval = 10m // * how often to check
check_command = "apt" // * call the plugin
command_endpoint = host.vars.remote_client // * execute the plugin on the remote machine
//vars.apt_only_critical = "1" //uncomment if you want.
assign where host.vars.remote_client && host.vars.linux_apt == "1" // * only check where remote client is set and vars.linux_apt is set to "1"
}
호스트 구성:
object Host "<HostName>" {
import "generic-host" // * default stuff
address = "<HostAddress>" // * default stuff
vars.linux_apt = "1" // * Set this host to be checked by the new service
vars.remote_client = "<HostNameAsConfiguredInZones.conf>" // * Needed for the remote service checks. Check `zones.conf` on what to insert here for your host.
}