I have one master and two satellite set-up. For a host, Iam monitoring following services, ping4, ssh, and power via snmp. We have parent-child dependency between the hosts.
I see that at-times, for some of the hosts the ip used to monitor is not same as ip which I have used for host in /etc/icinga2/zones.d/master/hosts.conf. The monitoring instead happens for some other ip of the host. For example if in hosts.conf file I have used the ip 10.1.1.1 for host A, and host A has other ip as 192.168.1.1, then at-times the monitoring happens on 192.168 ip for host A even though in hosts.conf I have used the ip 10.1.1.1.
It may happen that the ip 192.168 is not accessible from monitoring server, so in that case, the host is incorrectly shown as down.
Is this a bug or some issue with config from our side?
Iam using Icinga version r2.10.4-1 on Ubuntu 18.04.1.
‘icinga2 object list’ command doesnt seem to have option --Host. It has option --name, but when I give name as host A it doesnt give any output.
Anyway I have resolved the issue for now, by changing the id of object (changed, object Host “6C3B6BC06594” to object Host “6C3B6BC06594-2” ). But Iam sure I will run into these problems again (as I have before), so good to know how to resolve it in a proper way.
I would also check /etc/icinga2/zones.conf on the host and see if it has a different IP address than your config on the master, but also, if it has the IP addresses for its parent nodes. They could be arguing.
edit: seconds later your host.conf appears and I think my advice was entirely irrelevant.
I was giving the argument ‘display_name’ to command object list, instead of id. With command as object list --name “6C3B6BC06594” works. Note now I have resolved the problem of wrong ip address via the work-around by changing the id of the object (the id was 6C3B6BC0659 before, I changed it to 6C3B6BC06594 – i.e. added 4 at the end) . So Iam not facing the issue now.