Ad Widget

Collapse

Cannot find the "data" array in the received JSON object.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • magicker
    Junior Member
    • Apr 2019
    • 5

    #1

    Cannot find the "data" array in the received JSON object.

    Hi all,

    I finally give in and have resorted the asking.

    I have set up 20ish server so far.

    Out of the 20 only two are showing file system checks / network info from the Linux Servers Template.

    The others are all showing

    Cannot find the "data" array in the received JSON object.

    as far as I can tell they are all set up the same

    They all show the other tests

    the firewalls are all configured the same

    the clients are a mix of ubuntu 14.04 and 16.04

    The two taht work are 14.04 clients but I dont that that is relevent.

    Can anyone help me troubleshoot this

    debus on one server states

    16630:20190405:200507.765 Sending back [[{"{#FSNAME}":"/sys","{#FSTYPE}":"sysfs"},{"{#FSNAME}":"/proc","{#FSTYPE}":"proc"},{"{#FSNAME}":"/dev","{#FSTYPE}":"devtmpfs"},{"{#FSNAME}":"/dev/pts","{#FSTYPE}":"devpts"},{"{#FSNAME}":"/run","{#FSTYPE}":"tmpfs"},{"{#FSNAME}":"/","{#FSTYPE}":"ext4"},{"{#FSNAME}":"/sys/fs/cgroup","{#FSTYPE}":"tmpfs"},{"{#FSNAME}":"/sys/fs/fuse/connections","{#FSTYPE}":"fusectl"},{"{#FSNAME}":"/sys/kernel/debug","{#FSTYPE}":"debugfs"},{"{#FSNAME}":"/sys/kernel/security","{#FSTYPE}":"securityfs"},{"{#FSNAME}":"/run/lock","{#FSTYPE}":"tmpfs"},{"{#FSNAME}":"/run/shm","{#FSTYPE}":"tmpfs"},{"{#FSNAME}":"/run/user","{#FSTYPE}":"tmpfs"},{"{#FSNAME}":"/sys/fs/pstore","{#FSTYPE}":"pstore"},{"{#FSNAME}":"/boot","{#FSTYPE}":"ext4"},{"{#FSNAME}":"/backup","{#FSTYPE}":"ext4"},{"{#FSNAME}":"/sys/fs/cgroup/systemd","{#FSTYPE}":"cgroup"}]]

    so that looks like it should be working..

    but no data seems to make it to the server. The hosts just show:

    Status not supported | Cannot find the "data" array in the received JSON object.

    zabbix_server (Zabbix) 4.0.6

    zabbix_agentd (daemon) (Zabbix) 4.2.0

  • vso
    Zabbix developer
    • Aug 2016
    • 190

    #2
    Please use agent 4.06 or upgrade zabbix server to 4.2.0

    Comment

    • magicker
      Junior Member
      • Apr 2019
      • 5

      #3
      Good grief!! as simple as that
      As there were 20 agents out there I went for the upgrade server option.

      Once upgraded the missing data started to flow in perfectly

      THANK YOU!!!

      Comment

      • ryanjenson90
        Junior Member
        • Mar 2019
        • 1

        #4
        thank you so much.
        Was facing a similar issue.
        now it's a grief cause this seems simple. i read a similar article on https://techyhost.com/free-data-monitoring-apps/ for this
        hope this community grows in this wonderful pattern.
        Last edited by ryanjenson90; 05-08-2019, 14:09.

        Comment

        • gbiondi
          Member
          • Nov 2016
          • 75

          #5
          Hi,

          resolved with 'upgrade' zabbix server from 4.0.3 to 4.2.1
          Thanks a lot.

          gb

          Comment

          • DCEM
            Junior Member
            • Feb 2020
            • 2

            #6
            Hello, I had the same error today:

            "Cannot find the data array in the received JSON object."

            I did use the most recent ZABBIX version, but the issue was different - and powershell related.

            After quiet a while I noticed that the problem only arrose when there was only one object in the JSON

            So if I use this Powershell command to produce the example data:
            convertto-JSON(@{'location' = 'data1'},@{'location' = 'data2'})
            it will work fine.

            But with only one item it wont work:
            convertto-JSON(@{'location' = 'data1'})

            The issue seems to be that the convertto-JSON will only create an array if it is needed.
            so the output of example 1 is:
            [
            {
            "location": "data1"
            },
            {
            "location": "data2"
            }
            ]

            and the one of example 2 is:
            {
            "location": "data1"
            }

            I'm not sure if ZABBIX or powershell is to blame, but the solution or workarround is quite simple:
            just make sure it is an Array in powershell before you do the JSON conversion:
            convertto-JSON(@(@{'location' = 'data1'}))
            convertto-JSON(@(@{'location' = 'data1'},@{'location' = 'data2'}))

            will both work fine

            so insted of convertto-JSON( ) use convertto-JSON(@( ))

            The biggest issue why it took me so long to find this was the error-message and the different powershell behaviour.
            Searching arround i got the impresion that the data must *actually* be named "data" (JSON: {"data": ...

            I don't know if there is a best practice here but trying it didn't help at first:
            convertto-JSON(@{'data' = @{'location' = 'data1'}})
            will output:
            {
            "data": {
            "location": "data1"
            }
            }

            So the important part of the errormessage is the "array"

            I tought sharing might help somone with a similar issue.
            Also updating the documentation might help - a hint for powershell users...

            Greetings

            Comment

            Working...