Icinga using wrong ip address

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.

Any help would be greatly appreciated.

Thanks

Hello

Can you share the hosts.conf definition and also the output of the

icinga2 object list --Host host A

This is object definition in hosts.conf file

object Host "6C3B6BC06594" {
import "core-host"
display_name = "Navarro-New-Tik-r3"
address = "172.18.60.1"
vars.network = "172.18.60.0"
vars.parent = "0418D6A45ACD"
vars.hosttype = "router"
vars.watchStations = false
vars.hardware = "RouterBOARD 750G r3"
vars.critical_range = "@0:225"
vars.warning_range = "@225:235"
notes = "latlng: 39.201912,-123.761589"
vars.notifyProblems = "true"
vars.intermittentPower = "false"
vars.solarScheduled = "false"
vars.suspendedDisconnected = "false"
vars.noSubCPE = "false"
vars.client_endpoint = "manchester-l3-mon1.furtherreach.net"
command_endpoint = "manchester-l3-mon1.furtherreach.net"
}

‘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.

Thanks

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.

My zones.conf, if needed, is as follows,

object Endpoint "monitor.furtherreach.net" {
}

object Zone "master" {
    endpoints = [ "monitor.furtherreach.net" ]
}

object Endpoint "gualala-fm-mon1.furtherreach.net" {
}

object Zone "gualala-fm-mon1.furtherreach.net" {
    endpoints = [ "gualala-fm-mon1.furtherreach.net" ]
    parent = "master"
}

Thanks

icinga2 object list --type Host --name ...

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.

But output of object list command is

   Object '6C3B6BC06594' of type 'Host':
   % declared in '/etc/icinga2/zones.d/master/hosts.conf', lines 25023:1-25023:26
   * __name = "6C3B6BC06594"
   * action_url = ""
   * address = "172.18.60.1"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25026:3-25026:25
   * address6 = ""
   * check_command = "hostalive"
   % = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 37:3-37:29
   * check_interval = 240
   % = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 35:3-35:21
   * check_period = ""
   * check_timeout = null
   * command_endpoint = "manchester-l3-mon1.furtherreach.net"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25041:3-25041:58
   * display_name = "Navarro-New-Tik-r3"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25025:3-25025:37
   * enable_active_checks = true
   * enable_event_handler = true
   * enable_flapping = false
   * enable_notifications = true
   * enable_passive_checks = true
   * enable_perfdata = true
   * event_command = ""
   * flapping_threshold = 0
   * flapping_threshold_high = 30
   * flapping_threshold_low = 25
   * groups = [ ]
   * icon_image = ""
   * icon_image_alt = ""
   * max_check_attempts = 6
   % = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 34:3-34:24
   * name = "6C3B6BC06594"
   * notes = "latlng: 39.201912,-123.761589"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25034:3-25034:41
   * notes_url = ""
   * package = "_etc"
   * retry_interval = 30
   % = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 36:3-36:22
   * source_location
   * first_column = 1
   * first_line = 25023
   * last_column = 26
   * last_line = 25023
   * path = "/etc/icinga2/zones.d/master/hosts.conf"
   * templates = [ "6C3B6BC06594", "core-host" ]
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25023:1-25023:26
   % = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 33:1-33:25
   * type = "Host"
   * vars
   * client_endpoint = "manchester-l3-mon1.furtherreach.net"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25040:3-25040:62
   * critical_range = "@0:225"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25032:3-25032:32
   * hardware = "RouterBOARD 750G r3"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25031:3-25031:39
   * hosttype = "router"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25029:3-25029:26
   * intermittentPower = "false"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25036:3-25036:34
   * network = "172.18.60.0"
  % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25027:3-25027:30
   * noSubCPE = "false"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25039:3-25039:25
   * notifyProblems = "true"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25035:3-25035:30
   * parent = "0418D6A45ACD"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25028:3-25028:30
   * solarScheduled = "false"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25037:3-25037:31
   * suspendedDisconnected = "false"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25038:3-25038:38
   * warning_range = "@225:235"
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25033:3-25033:33
   * watchStations = false
   % = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 25030:3-25030:28
   * volatile = false
   * zone = "master"

Does this indicate any issue?

Thanks