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

Encoding issues found when using vfs.file.contents, regexp and regmatch

XMLWordPrintable

      OS: Windows
      Agent: Agent 1 (Zabbix Agentd)
      Steps to reproduce:
      1) Create .txt file in UTF8 encoding.
      2) Add - Helloworld! to file.
      3) Open file with Notepad++.
      4) In Notepad++ there is buildin Encoding functionality.

      5) Convert file from UTF8 to UTF-16LE BOM

      6) Navigate to Zabbix UI (server and agent running) and create item with key

      vfs.file.regexp[link_to_your_file\test_error.txt,H,UTF-16LE]

      1st parameter - link to file.
      2nd parameter - H (our regex)"
      3rd parameter - UTF-16LE (file encoding).
      7) We can wait until Zabbix collects values from file or just press Test in item.

      Result:

      Result displayed as - ??H.
      Why there is question marks?

      Expected:
      Helloworld! displayed (as expected).

      Additional info (w - windows, L - linux):
      1w - changing 3rd parameter to UTF-16 - correct data displayed.
      2w - same ??H displayed when you change 3rd parameter to UTF-16BE.
      3L - repeating this scenario on Linux - everything works as expected (Helloworld! displayed as result).
      4w - using 2nd parameter UTF-16LE for key vfs.file.contents - ??H displayed as result.
      5w - using 3rd parameter UTF-16LE for key vfs.file.regmatch - 1 displayed as result.
      6w - with Agent2, using same file/item/key - correct data returned (Helloworld! not ??H).

        1. converted_to_16.png
          converted_to_16.png
          3 kB
        2. encoding_in_notepad.png
          encoding_in_notepad.png
          11 kB
        3. screenshot-1.png
          screenshot-1.png
          22 kB
        4. screenshot-2.png
          screenshot-2.png
          25 kB
        5. tested_utf16LE.png
          tested_utf16LE.png
          23 kB

            arimdjonoks Artjoms Rimdjonoks
            smaklakovs Sergejs Maklakovs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: