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

Key having character ' may lead to incorrect SQL statement

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • 1.4.3
    • 1.4.3
    • Server (S)
    • None

      et following error message in zabbix_server.log:
      10260:20071108:133651 Query returned empty result
      10260:20071108:133651 Query::select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.errors_from,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status,i.trapper_hosts,i.logtimefmt,i.valuemapid,i.delay_flex,h.dns from hosts h, items i where h.host='srv-vm-wsus-01' and h.hostid=i.hostid and i.key_='system.run[wmic /output:wmic.out service where "Startmode='Auto' and state!='Running'" get DisplayName /Format:csv | type wmic.out]' and h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)
      10260:20071108:133651 Query failed:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Auto' and state!='Running'" get DisplayName /Format:csv | type wmic.out]' and h.' at line 1 [1064]

      As u can see, I have a item with key: system.run[wmic /output:wmic.out service where "Startmode='Auto' and state!='Running'" get DisplayName /Format:csv | type wmic.out] ( NOTE the ' in the Key), as it seems the " ' " is not allowed as character in a key !!!!

            alexei Alexei Vladishev
            alexei Alexei Vladishev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: