Score:0

Icinga2 hosts are marked as Pending and unhandled

my flag
Tom

I am trying to configure a icinga2 cluster of multiple nodes (agents) and one master.

I am using this Ansible role to do this.

Hostnames are resolved using entries inside /etc/hosts.

The problem I am having is that the hosts inside icingaweb2 are marked as Pending and unhandled.

On the master I get the following error messages:

[2021-06-21 11:50:25 +0200] warning/JsonRpcConnection: API client disconnected for identity 'mongodb-000'
[2021-06-21 11:50:33 +0200] warning/ApiListener: Certificate validation failed for endpoint 'mongodb-000': code 18: self signed certificate

On an endpoint it's the same:

[2021-06-21 11:53:53 +0200] warning/JsonRpcConnection: API client disconnected for identity 'icinga-000'
[2021-06-21 11:53:55 +0200] warning/ApiListener: Certificate validation failed for endpoint 'icinga-000': code 18: self signed certificate

When I query the API to check which endpoints are connected all nodes are shown as not_conn_endpoints:

root@icinga-000:/home/ansible# curl --user icinga2:nope --silent --insecure --header 'Accept: application/json' https://localhost:5665/v1/status/ApiListener | jq --raw-output ".results[].status"
{
  "api": {
    "conn_endpoints": [],
    "http": {
      "clients": 1
    },
    "identity": "icinga-000",
    "json_rpc": {
      "anonymous_clients": 18,
      "relay_queue_item_rate": 0.7333333333333333,
      "relay_queue_items": 0,
      "sync_queue_item_rate": 0,
      "sync_queue_items": 0,
      "work_queue_item_rate": 1.2833333333333334
    },
    "not_conn_endpoints": [
      "app-manager-001",
      "mongodb-000",
      "app-worker-001",
      "global-cloud-proxy-000",
      "openvpn-000",
      "mongodb-001",
      "mongodb-arbiter-000",
      "teleport-000",
      "minio-000",
      "app-worker-000",
      "app-manager-002",
      "graylog-manager-000",
      "app-manager-000"
    ],
    "num_conn_endpoints": 0,
    "num_endpoints": 13,
    "num_not_conn_endpoints": 13,
    "zones": {
      "app-manager-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "app-manager-000"
        ],
        "parent_zone": "master"
      },
      "app-manager-001": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "app-manager-001"
        ],
        "parent_zone": "master"
      },
      "app-manager-002": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "app-manager-002"
        ],
        "parent_zone": "master"
      },
      "app-worker-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "app-worker-000"
        ],
        "parent_zone": "master"
      },
      "app-worker-001": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "app-worker-001"
        ],
        "parent_zone": "master"
      },
      "global-cloud-proxy-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "global-cloud-proxy-000"
        ],
        "parent_zone": "master"
      },
      "graylog-manager-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "graylog-manager-000"
        ],
        "parent_zone": "master"
      },
      "master": {
        "client_log_lag": 0,
        "connected": true,
        "endpoints": [
          "icinga-000"
        ],
        "parent_zone": ""
      },
      "minio-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "minio-000"
        ],
        "parent_zone": "master"
      },
      "mongodb-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "mongodb-000"
        ],
        "parent_zone": "master"
      },
      "mongodb-001": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "mongodb-001"
        ],
        "parent_zone": "master"
      },
      "mongodb-arbiter-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "mongodb-arbiter-000"
        ],
        "parent_zone": "master"
      },
      "openvpn-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "openvpn-000"
        ],
        "parent_zone": "master"
      },
      "teleport-000": {
        "client_log_lag": 0,
        "connected": false,
        "endpoints": [
          "teleport-000"
        ],
        "parent_zone": "master"
      }
    }
  }
}

The configuration can be found down below.

Master configuration

root@icinga-000:/etc/icinga2# cat zones.d/mongodb-000/mongodb-000.conf 
// Ansible managed


object Host "mongodb-000" {
  display_name = "mongodb-000"
  command_endpoint = "mongodb-000"
  zone = "mongodb-000"
  address = "192.168.80.40"
import "generic-host"
  vars = {
    os = "Linux"
    dist = "Ubuntu"
    dist_ver = "20.04"
    disks = {
      "disk /" = {
        disk_partitions = "/"
      }
    }
    services = [ "uptime", "memory", "load" ]
    memory = true

  }
}

I want to configure the nodes as agents, but for some reason the ansible role also creates sattelites config files. Not sure what's going on here...

root@icinga-000:/etc/icinga2# cat satellites.d/mongodb-000.conf
// Ansible managed

// defined zone: mongodb-000
object Endpoint "mongodb-000" { host = "mongodb-000"; port = "5665" }
object Zone "mongodb-000" { endpoints = [ "mongodb-000" ] ; parent = "master" }
  

Node configuration

root@mongodb-000:/etc/icinga2# cat zones.conf
// Ansible managed

object Endpoint "icinga-000" { host = "192.168.80.140";   port = "5665" }
object Zone "master" { endpoints = [ "icinga-000" ] }

object Endpoint "mongodb-000" { host = "mongodb-000"; port = "5665" }
object Zone "mongodb-000" { endpoints = [ "mongodb-000" ] ; parent = "master" }
  
object Zone "global-templates" { global = true }
object Zone "director-global"  { global = true }

I'm guessing there is an error inside the configuration, but since I'm new to icinga and monitoring-portal.org has been shutdown and all the links are now dead, I am at a loss why it's not working. Any pointers are highly appreciated.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.