Ad Widget

Collapse

zabbix api 3.2.4 JSON error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • billjam
    Junior Member
    • Jan 2009
    • 27

    #1

    zabbix api 3.2.4 JSON error

    I have a simple perl script that grabs some info about Zabbix hosts using perl JSON commands.
    Works fine on zabbix 2.4.5 but when I try same script from client with same config it gives JSON error:

    malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at (eval 4) line 161.

    The data I'm gathering is:
    my $json_item_get = JSON::XS->new->pretty(0)->encode(
    { jsonrpc => 2.0,
    method => "item.get",
    params => {
    output => ['hostid','state','name','status','error'],
    },
    auth => "$auth",
    id => 2
    });

    If I change the "output" line to "output => ['hostid','state','status','error']" or "output => ['hostid','state','name']," it works fine.
    Not sure why adding the 5 columns causes it to break.

    I'm running on centos 7:
    perl-JSON-2.90-1.of.el7.noarch
    perl-JSON-XS-3.01-2.el7.x86_64
Working...