ZABBIX BUGS AND ISSUES

server-side json parser does not handle whitespace properly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.4rc1
  • Fix Version/s: 1.8.5
  • Component/s: Server (S)
  • Labels:
    None
  • Zabbix ID:
    NA

Description

Consider the following JSON for file system discovery:

 {
    "vfs.fs.type.discovery":[
    
    { "{#FSNAME}":"\/", "{#FSTYPE}":"rootfs" },
    { "{#FSNAME}":"\/sys", "{#FSTYPE}":"sysfs" },
    { "{#FSNAME}":"\/proc", "{#FSTYPE}":"proc" },
    { "{#FSNAME}":"\/dev", "{#FSTYPE}":"devtmpfs" },
    { "{#FSNAME}":"\/dev\/pts", "{#FSTYPE}":"devpts" },
    { "{#FSNAME}":"\/", "{#FSTYPE}":"ext3" },
    { "{#FSNAME}":"\/lib\/init\/rw", "{#FSTYPE}":"tmpfs" },
    { "{#FSNAME}":"\/dev\/shm", "{#FSTYPE}":"tmpfs" },
    { "{#FSNAME}":"\/home", "{#FSTYPE}":"ext3" },
    { "{#FSNAME}":"\/tmp", "{#FSTYPE}":"ext3" },
    { "{#FSNAME}":"\/usr", "{#FSTYPE}":"ext3" },
    { "{#FSNAME}":"\/var", "{#FSTYPE}":"ext3" },
    { "{#FSNAME}":"\/sys\/fs\/fuse\/connections", "{#FSTYPE}":"fusectl" }
    
    ]
  }

Our JSON parser requires that there is no whitespace around the colon. If there is whitespace, server says "Wrong data in JSON.", which is not a very helpful error message.

We should improve our JSON parser so that we are more helpful to users wishing to implement their own discoveries in 2.0.

Activity

Hide
Aleksandrs Saveljevs added a comment -

See http://www.json.org/ for more information on JSON.

Show
Aleksandrs Saveljevs added a comment - See http://www.json.org/ for more information on JSON.
Hide
Aleksandrs Saveljevs added a comment -

Made our JSON parser ignore whitespace better. Development branch: svn://svn.zabbix.com/branches/dev/ZBX-3173.

Show
Aleksandrs Saveljevs added a comment - Made our JSON parser ignore whitespace better. Development branch: svn://svn.zabbix.com/branches/dev/ZBX-3173.
Hide
Aleksandrs Saveljevs added a comment -

Available in pre-1.8.5 in r16964.

Show
Aleksandrs Saveljevs added a comment - Available in pre-1.8.5 in r16964.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: