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

Zabbix Crashes with JavaScript pre-processing

    XMLWordPrintable

Details

    • Problem report
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 5.2.5
    • None
    • Server (S)
    • None

    Description

      HTTP based check with a preprocessing step of certain javascript causes Zabbix to crash.

      Item is calling an HTTP API, and if it would go unsupported value is set to APIFAIL and carried through the JS function.

      JS Function that causes crash is:

      ============
      
      switch(value)
      
      { case 'APIFAIL': return 'APIFAIL'; break; case '[]': return 0; break; default: return parseJson(value); }
      
      function parseJson(value)
       {
       var obj = JSON.parse(value);
      
      var parsedJson =
      
      { "alarm_state": obj[0].alarm_state, "alarm_id": obj[0].alarm_id, "alert_severity": obj[0].alert_severity, "alert_dimension": obj[0].alert_dimension, "policy_name": obj[0].policy_name, "alert_key_lookup": obj[0].alert_key_lookup, "mitigation_id": obj[0].mitigation_id }
      
      var json = JSON.stringify(parsedJson);
      
      return json;
       }
      
      ============
      

      Screenshots and log file attached.

      Attachments

        Issue Links

          Activity

            People

              zabbix.dev Zabbix Development Team
              bcarter Ben Carter
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: