Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-14530

Does zabbix API JSON strings violates RFC7159?

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Incomplete
    • Icon: Major Major
    • None
    • 3.4.11
    • API (A)
    • None

      One of the users which is using my https://github.com/kloczek/zapish reported that on Debian which is using as /bin/sh dash scripts dumping templates are failing wit error like:

      parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 

      I don't see such issues on ksh or bash so I've started looking for comments about this error message.

      I found https://github.com/stedolan/jq/issues/1049
      in which is:

      @rupenp RFC7159 a) does not allow any control characters other than some whitespace (tabs and newlines) in JSON texts, and b) requires that they be escaped when in strings. If you have JSON texts that violate one of these requirements, you can try to get around them with sed(1). Something like sed -e s/\t/\\t/g -e ..., perhaps, for violations of (b), for example.

      Looks like a bug in zabbix API because in generated output those characters are not escaped.

            Unassigned Unassigned
            kloczek Tomasz Kłoczko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: