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

Zabbix Server crashes when using regex with xml 'text' item

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Workaround proposed
    • Icon: Critical Critical
    • None
    • 3.4.6, 3.4.7
    • Server (S)

      Steps to reproduce:

      I'm afraid, what it's a ... a specific situation. I am not sure, that it can be reproduced easily... But i hope you can explain what is it a problem and how can i avoid it... Or you can fix it, if it's a real bug in preprocessing with regex.

      Configure Item as "Telnet agent", our target - HP MSA (P2000 or 2050SAN, etc).

      Executed script: 2 (step-by-step) commands, to get an xml responce from remote system
      set cli-parameters base 10 api brief enabled pager disabled
      show disks 1.1

      Type of information: text

      If i stop at this step, all works perfectly. I receive a full text output from telnet commands. You can see full output at the attached log file "hp_msa_xml_out.txt"

      But i need to reduse output garbage: i need to clean out all strings from "set cli-parameters base 10 api brief enabled pager disabled" to "# show disks 1.1".

      To do it, i will use this regexp:

      E>\n.*?\n((?=<\?xml)(?:(?:.*?\r?\n?)*)E>)
      

      Output formatting: \0

      Sure, all next parsing steps (XML items to values mapping) will be done at dependent items, with XPATH directives.
      Type of information: various, character or numerics of any allowed types

      Result:

      If i add this regexp (i do not create any dependent item at this moment) and right after next Item's data refresh interval, zabbix daemon is crashed (died).

      Typical log entries at this case:

      2262:20180228:161551.330 One child process died (PID:3016,exitcode/signal:11). Exiting ...
      2262:20180228:161553.351 syncing history data...
      2262:20180228:161553.451 syncing history data done
      2262:20180228:161553.451 syncing trend data...

      Full debug log (L4) - at attached file "zabbix.log".

      Expected:

      As expected results, i need to get correct data in item, must looks like data in attached file "hp_msa_xml_out_expected.txt"

        1. hp_msa_xml_out_expected.txt
          6 kB
        2. hp_msa_xml_out.txt
          6 kB
        3. Success.png
          Success.png
          9 kB
        4. Updated result of regexp.png
          Updated result of regexp.png
          3 kB

            Unassigned Unassigned
            Anth(0)ny Anth0ny
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: