Host added on icinga agent node not visible on icinga master node

Can anyone help on this??

Hi @vasugupta32,
Could you please add some details on what exactly you are expecting and what exactly you did?

My best guess so far is: You added a host to the configuration on an Agent and not on the master. It doesn’t work that way.
In most case you want to create the configuration on the master and synchronise it down to agents/satellites (Icinga2 does that for you).

Hi @lorenz

I’m trying to add hosts and wanted to watch alerts on the master UI.

I have setup one master node and one agent node-

  • master node- inicg02p1.dev.smf1.mobitv

  • agent node- inicg03p1.dev.smf1.mobitv

Here is my configuration-


root@inicg02p1.dev.smf1.mobitv: /etc/icinga2# cat zones.conf
object Endpoint "icinga2-master1.localdomain" {
  // That's us
}

object Endpoint "icinga2-agent1.localdomain" {
  host = "10.174.164.161" // The master actively tries to connect to the agent
  log_duration = 0 // Disable the replay log for command endpoint agents
}


object Zone "master" {
  endpoints = [ "icinga2-master1.localdomain" ]
}

object Zone "icinga2-agent1.localdomain" {
  endpoints = [ "icinga2-agent1.localdomain" ]

  parent = "master"
}


/* sync global commands */
object Zone "global-templates" {
  global = true
}
object Zone "director-global" {
  global = true
}

root@inicg03p1.dev.smf1.mobitv: /etc/icinga2# cat zones.conf
/*
 * Generated by Icinga 2 node setup commands
 * on 2024-01-16 10:06:27 +0000
 */

object Endpoint "icinga2-master1.localdomain" {
        host = "10.174.165.114"
        port = "5665"
}

object Zone "master" {
        endpoints = [ "icinga2-master1.localdomain" ]
}

object Endpoint "icinga2-agent1.localdomain" {
}

object Zone "icinga2-agent1.localdomain" {
        endpoints = [ "icinga2-agent1.localdomain" ]
        parent = "master"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

root@inicg02p1.dev.smf1.mobitv: /etc/icinga2/zones.d/master# cat hosts.conf
object Host "icinga2-agent1.localdomain" {
  check_command = "hostalive"
  address = "10.174.164.161"

  vars.agent_endpoint = name //follows the convention that host name == endpoint name
}


root@inicg02p1.dev.smf1.mobitv: /etc/icinga2/zones.d/master# cat services.conf
apply Service "ping4" {
  check_command = "ping4"

  //check is executed on the master node
  assign where host.address
}

apply Service "disk" {
  check_command = "disk"

  // Execute the check on the remote command endpoint
  command_endpoint = host.vars.agent_endpoint

  // Assign the service onto an agent
  assign where host.vars.agent_endpoint
}

Till here all looks good and working-

Now I want to add more host and push them on the agent node and the alerts of these host wanted to watch on master UI.

what exactly configuration required for this?, I have tested multiple things but no luck

Hi @lorenz
Can you help me here?

If you want to have the checks for the additional Hosts executed on inicg03p1.dev.smf1.mobitv (which technically makes this a satellite and not an agent, but that’s just wording); create a directory icinga2-agent1.localdomain in /etc/icinga2/zones.d on your master ( inicg02p1.dev.smf1.mobitv ) and put the configuration files containing those Hosts in that directory.