Ad Widget

Collapse

AKS monitoring problem

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wooch
    Junior Member
    • Oct 2022
    • 9

    #1

    AKS monitoring problem

    Hi everyone,
    there is a problem with Kubernetes Nodes by HTTP template, Node.LLD has "Not Supported" status:
    Click image for larger version

Name:	image.png
Views:	1273
Size:	105.4 KB
ID:	459447
    The error is:
    Preprocessing failed for: {"error":"Request failed with status code 401: {"kind":"Status","apiVersion":"v1","met ad ...
    1. Failed: Discovery error: TypeError: cannot read property 1 of null.


    I have two macros:
    Click image for larger version

Name:	image.png
Views:	1075
Size:	55.5 KB
ID:	459448

    Do you have any ideas what's wrong with my settings?

    I used this article for implementing the monitoring.
    My Zabbix version 6.2.6
    Helm chart version 6.2
    ​​
  • Answer selected by wooch at 07-03-2023, 09:10.
    jakub.imbrzykowski
    Junior Member
    • Feb 2023
    • 2

    Originally posted by jakub.imbrzykowski
    Hi, i have the same issue but with other cloud provider.

    The reason of this is not having a port number in {$KUBE.API.ENDPOINT.URL}, proper API URL should match pattern in description.
    Regex in Node LLD script is jut required it.

    Code:
    api_url = '{$KUBE.API.ENDPOINT.URL}',
    hostname = api_url.match(/\/\/(.+):/);​
    Unfortunately for me, after fix that i have next error "Discovery error: TypeError: unexpected type.".
    My Kubernetes API dose not returns "endpointIPs" field in JSON response...
    Code:
    if (internalIP in input.endpointIPs) {

    Good luck!

    I goes deeper into scripts and i find out that missing port was my only problem.
    "endpointIPs" field was properly added by another script requesting Kubernetes API for nodes.

    Currently my nodes has bean successfully discovered

    Comment

    • wooch
      Junior Member
      • Oct 2022
      • 9

      #2
      Sorry, I posted the wrong error message.
      The correct one is:
      Preprocessing failed for: {"kind":"NodeList","apiVersion":"v1","metadata" :{" resourceVersion":"38159554"},"items":[{"metadat...
      1. Failed: Discovery error: TypeError: cannot read property 1 of null.

      Comment

      • jakub.imbrzykowski
        Junior Member
        • Feb 2023
        • 2

        #3
        Hi, i have the same issue but with other cloud provider.

        The reason of this is not having a port number in {$KUBE.API.ENDPOINT.URL}, proper API URL should match pattern in description.
        Regex in Node LLD script is jut required it.

        Code:
        api_url = '{$KUBE.API.ENDPOINT.URL}',
        hostname = api_url.match(/\/\/(.+):/);​
        Unfortunately for me, after fix that i have next error "Discovery error: TypeError: unexpected type.".
        My Kubernetes API dose not returns "endpointIPs" field in JSON response...
        Code:
        if (internalIP in input.endpointIPs) {

        Good luck!

        Comment

        • jakub.imbrzykowski
          Junior Member
          • Feb 2023
          • 2

          #4
          Originally posted by jakub.imbrzykowski
          Hi, i have the same issue but with other cloud provider.

          The reason of this is not having a port number in {$KUBE.API.ENDPOINT.URL}, proper API URL should match pattern in description.
          Regex in Node LLD script is jut required it.

          Code:
          api_url = '{$KUBE.API.ENDPOINT.URL}',
          hostname = api_url.match(/\/\/(.+):/);​
          Unfortunately for me, after fix that i have next error "Discovery error: TypeError: unexpected type.".
          My Kubernetes API dose not returns "endpointIPs" field in JSON response...
          Code:
          if (internalIP in input.endpointIPs) {

          Good luck!

          I goes deeper into scripts and i find out that missing port was my only problem.
          "endpointIPs" field was properly added by another script requesting Kubernetes API for nodes.

          Currently my nodes has bean successfully discovered

          Comment

          • Sarang-D
            Junior Member
            • Sep 2023
            • 5

            #5
            Hello @jakub.imbrzykowsk/@​wooch ​ I have installed zabbix kube monitoring helm chart on AKS cluster and set macros correctly. I am receiving data for kubelet discovery: Kubernetes Kubelet by HTTP Template. However, Kubernetes nodes by HTTP: Node LLD: Cluster node discovery not working. It's unable to create additional host and attach “Linux by Zabbix Agent” template to it. Can you please provide suggestions?
            Note: Master Item "Kubernetes: Get node" is extracting the JSON payload. However, Node LLD item preprocessing returns error as "Discovery error: SyntaxError: invalid json (at offset 1)"

            Details:
            Version: zabbix 6.0
            Macros:
            {$KUBE.API.ENDPOINT.URL}
            {$KUBE.API.TOKEN}
            {$KUBE.NODES.ENDPOINT.NAME}​
            Click image for larger version

Name:	image.png
Views:	877
Size:	127.4 KB
ID:	481937
            Click image for larger version

Name:	image.png
Views:	718
Size:	26.2 KB
ID:	481938Click image for larger version

Name:	image.png
Views:	701
Size:	53.8 KB
ID:	481939

            Comment

            Working...