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

Passing in null value for Item formula property resulting in different formula responses in item.create vs item.update

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 2.4.7
    • API (A)

      Documentation for Item ( https://www.zabbix.com/documentation/2.4/manual/api/reference/item/object ) describes formula property as type of integer/float with description of Custom multiplier. Default: 1.

      When passing in json for Item formula property as "formula":null during item.create results in an item.get returning the value as "formula":"1" but when passing same json during item.update the item.get returns the value of "formula":"". Should the responses from these methods be different?

      Example Request and Response http client logging for item.create followed by item.get:

      13:32:36.130 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "POST /zabbix/api_jsonrpc.php HTTP/1.1[\r][\n]"
      13:32:36.130 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "Accept: text/plain, application/json, application/*+json, */*[\r][\n]"
      13:32:36.130 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
      13:32:36.130 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "Content-Length: 926[\r][\n]"
      13:32:36.130 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "Host: host.domain.com[\r][\n]"
      13:32:36.130 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "Connection: Keep-Alive[\r][\n]"
      13:32:36.131 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
      13:32:36.131 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "Accept-Encoding: gzip,deflate[\r][\n]"
      13:32:36.131 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "[\r][\n]"
      13:32:36.132 DEBUG [main]  org.apache.http.wire - http-outgoing-25 >> "{"id":26,"method":"item.create","params":[{"value_type":3,"key_":"jmx[\"java.lang:type=Memory\",\"HeapMemoryUsage.used\"]","hostid":"10613","name":"HeapMemoryUsage.used 1106","delay":30,"type":16,"interfaceid":"798","itemid":null,"authtype":null,"data_type":null,"delay_type":null,"delay_flex":null,"delta":null,"description":null,"flags":null,"formula":null,"history":null,"inventory_link":null,"ipmi_sensor":null,"lastclock":null,"lastns":null,"lastvalue":null,"multiplier":null,"params":null,"password":null,"port":null,"prevorgvalue":null,"prevvalue":null,"privatekey":null,"publickey":null,"snmp_community":null,"snmp_oid":null,"snmpv3_authpassphrase":null,"snmpv3_privpassphrase":null,"snmpv3_securitylevel":null,"snmpv3_securityname":null,"status":null,"trapper_hosts":null,"trends":null,"units":null,"username":null,"valuemapid":null,"applications":["9247"]}],"jsonrpc":"2.0","auth":"c8dbb05c3e1426b416d125fef0a767ed"}"
      13:32:36.239 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "HTTP/1.1 200 OK[\r][\n]"
      13:32:36.240 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Date: Mon, 21 Dec 2015 19:35:19 GMT[\r][\n]"
      13:32:36.241 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Server: Apache/2.2.15 (Red Hat)[\r][\n]"
      13:32:36.242 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "X-Powered-By: PHP/5.3.3[\r][\n]"
      13:32:36.243 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Access-Control-Allow-Origin: *[\r][\n]"
      13:32:36.243 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Access-Control-Allow-Headers: Content-Type[\r][\n]"
      13:32:36.244 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Access-Control-Allow-Methods: POST[\r][\n]"
      13:32:36.245 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Access-Control-Max-Age: 1000[\r][\n]"
      13:32:36.245 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Content-Length: 56[\r][\n]"
      13:32:36.246 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Connection: close[\r][\n]"
      13:32:36.247 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "Content-Type: application/json[\r][\n]"
      13:32:36.247 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "[\r][\n]"
      13:32:36.248 DEBUG [main]  org.apache.http.wire - http-outgoing-25 << "{"jsonrpc":"2.0","result":{"itemids":["76182"]},"id":26}"
      13:32:37.637 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "POST /zabbix/api_jsonrpc.php HTTP/1.1[\r][\n]"
      13:32:37.637 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "Accept: text/plain, application/json, application/*+json, */*[\r][\n]"
      13:32:37.638 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
      13:32:37.638 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "Content-Length: 136[\r][\n]"
      13:32:37.638 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "Host: host.domain.com[\r][\n]"
      13:32:37.638 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "Connection: Keep-Alive[\r][\n]"
      13:32:37.639 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
      13:32:37.639 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "Accept-Encoding: gzip,deflate[\r][\n]"
      13:32:37.639 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "[\r][\n]"
      13:32:37.640 DEBUG [main]  org.apache.http.wire - http-outgoing-26 >> "{"id":27,"method":"item.get","params":{"output":"extend","itemids":["76182"]},"jsonrpc":"2.0","auth":"c8dbb05c3e1426b416d125fef0a767ed"}"
      13:32:37.733 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "HTTP/1.1 200 OK[\r][\n]"
      13:32:37.733 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Date: Mon, 21 Dec 2015 19:35:20 GMT[\r][\n]"
      13:32:37.734 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Server: Apache/2.2.15 (Red Hat)[\r][\n]"
      13:32:37.734 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "X-Powered-By: PHP/5.3.3[\r][\n]"
      13:32:37.735 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Access-Control-Allow-Origin: *[\r][\n]"
      13:32:37.735 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Access-Control-Allow-Headers: Content-Type[\r][\n]"
      13:32:37.736 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Access-Control-Allow-Methods: POST[\r][\n]"
      13:32:37.736 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Access-Control-Max-Age: 1000[\r][\n]"
      13:32:37.737 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Content-Length: 956[\r][\n]"
      13:32:37.737 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Connection: close[\r][\n]"
      13:32:37.738 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "Content-Type: application/json[\r][\n]"
      13:32:37.738 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "[\r][\n]"
      13:32:37.741 DEBUG [main]  org.apache.http.wire - http-outgoing-26 << "{"jsonrpc":"2.0","result":[{"itemid":"76182","type":"16","snmp_community":"","snmp_oid":"","hostid":"10613","name":"HeapMemoryUsage.used 1106","key_":"jmx[\"java.lang:type=Memory\",\"HeapMemoryUsage.used\"]","delay":"30","history":"90","trends":"365","status":"0","value_type":"3","trapper_hosts":"","units":"","multiplier":"0","delta":"0","snmpv3_securityname":"","snmpv3_securitylevel":"0","snmpv3_authpassphrase":"","snmpv3_privpassphrase":"","formula":"1","error":"","lastlogsize":"0","logtimefmt":"","templateid":"0","valuemapid":"0","delay_flex":"","params":"","ipmi_sensor":"","data_type":"0","authtype":"0","username":"","password":"","publickey":"","privatekey":"","mtime":"0","flags":"0","interfaceid":"798","port":"","description":"","inventory_link":"0","lifetime":"30","snmpv3_authprotocol":"0","snmpv3_privprotocol":"0","state":"0","snmpv3_contextname":"","evaltype":"0","lastclock":"0","lastns":"0","lastvalue":"0","prevvalue":"0"}],"id":27}"
      

      Example Request and Response http client logging for item.update followed by item.get:

      13:32:40.909 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "POST /zabbix/api_jsonrpc.php HTTP/1.1[\r][\n]"
      13:32:40.910 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "Accept: text/plain, application/json, application/*+json, */*[\r][\n]"
      13:32:40.911 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
      13:32:40.911 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "Content-Length: 929[\r][\n]"
      13:32:40.911 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "Host: host.domain.com[\r][\n]"
      13:32:40.912 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "Connection: Keep-Alive[\r][\n]"
      13:32:40.912 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
      13:32:40.912 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "Accept-Encoding: gzip,deflate[\r][\n]"
      13:32:40.913 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "[\r][\n]"
      13:32:40.915 DEBUG [main]  org.apache.http.wire - http-outgoing-27 >> "{"id":28,"method":"item.update","params":[{"value_type":3,"key_":"jmx[\"java.lang:type=Memory\",\"HeapMemoryUsage.used\"]","hostid":"10613","name":"HeapMemoryUsage.used 1106","delay":30,"type":16,"interfaceid":"798","itemid":"76182","authtype":null,"data_type":null,"delay_type":null,"delay_flex":null,"delta":null,"description":null,"flags":null,"formula":null,"history":null,"inventory_link":null,"ipmi_sensor":null,"lastclock":null,"lastns":null,"lastvalue":null,"multiplier":null,"params":null,"password":null,"port":null,"prevorgvalue":null,"prevvalue":null,"privatekey":null,"publickey":null,"snmp_community":null,"snmp_oid":null,"snmpv3_authpassphrase":null,"snmpv3_privpassphrase":null,"snmpv3_securitylevel":null,"snmpv3_securityname":null,"status":null,"trapper_hosts":null,"trends":null,"units":null,"username":null,"valuemapid":null,"applications":["9247"]}],"jsonrpc":"2.0","auth":"c8dbb05c3e1426b416d125fef0a767ed"}"
      13:32:41.023 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "HTTP/1.1 200 OK[\r][\n]"
      13:32:41.024 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Date: Mon, 21 Dec 2015 19:35:23 GMT[\r][\n]"
      13:32:41.024 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Server: Apache/2.2.15 (Red Hat)[\r][\n]"
      13:32:41.025 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "X-Powered-By: PHP/5.3.3[\r][\n]"
      13:32:41.025 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Access-Control-Allow-Origin: *[\r][\n]"
      13:32:41.025 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Access-Control-Allow-Headers: Content-Type[\r][\n]"
      13:32:41.026 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Access-Control-Allow-Methods: POST[\r][\n]"
      13:32:41.026 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Access-Control-Max-Age: 1000[\r][\n]"
      13:32:41.026 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Content-Length: 56[\r][\n]"
      13:32:41.027 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Connection: close[\r][\n]"
      13:32:41.027 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "Content-Type: application/json[\r][\n]"
      13:32:41.027 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "[\r][\n]"
      13:32:41.028 DEBUG [main]  org.apache.http.wire - http-outgoing-27 << "{"jsonrpc":"2.0","result":{"itemids":["76182"]},"id":28}"
      13:32:47.538 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "POST /zabbix/api_jsonrpc.php HTTP/1.1[\r][\n]"
      13:32:47.538 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "Accept: text/plain, application/json, application/*+json, */*[\r][\n]"
      13:32:47.538 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
      13:32:47.539 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "Content-Length: 136[\r][\n]"
      13:32:47.539 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "Host: host.domain.com[\r][\n]"
      13:32:47.539 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "Connection: Keep-Alive[\r][\n]"
      13:32:47.539 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
      13:32:47.539 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "Accept-Encoding: gzip,deflate[\r][\n]"
      13:32:47.540 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "[\r][\n]"
      13:32:47.540 DEBUG [main]  org.apache.http.wire - http-outgoing-28 >> "{"id":29,"method":"item.get","params":{"output":"extend","itemids":["76182"]},"jsonrpc":"2.0","auth":"c8dbb05c3e1426b416d125fef0a767ed"}"
      13:32:47.627 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "HTTP/1.1 200 OK[\r][\n]"
      13:32:47.628 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Date: Mon, 21 Dec 2015 19:35:30 GMT[\r][\n]"
      13:32:47.628 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Server: Apache/2.2.15 (Red Hat)[\r][\n]"
      13:32:47.628 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "X-Powered-By: PHP/5.3.3[\r][\n]"
      13:32:47.628 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Access-Control-Allow-Origin: *[\r][\n]"
      13:32:47.628 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Access-Control-Allow-Headers: Content-Type[\r][\n]"
      13:32:47.628 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Access-Control-Allow-Methods: POST[\r][\n]"
      13:32:47.629 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Access-Control-Max-Age: 1000[\r][\n]"
      13:32:47.629 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Content-Length: 955[\r][\n]"
      13:32:47.629 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Connection: close[\r][\n]"
      13:32:47.629 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "Content-Type: application/json[\r][\n]"
      13:32:47.629 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "[\r][\n]"
      13:32:47.630 DEBUG [main]  org.apache.http.wire - http-outgoing-28 << "{"jsonrpc":"2.0","result":[{"itemid":"76182","type":"16","snmp_community":"","snmp_oid":"","hostid":"10613","name":"HeapMemoryUsage.used 1106","key_":"jmx[\"java.lang:type=Memory\",\"HeapMemoryUsage.used\"]","delay":"30","history":"90","trends":"365","status":"0","value_type":"3","trapper_hosts":"","units":"","multiplier":"0","delta":"0","snmpv3_securityname":"","snmpv3_securitylevel":"0","snmpv3_authpassphrase":"","snmpv3_privpassphrase":"","formula":"","error":"","lastlogsize":"0","logtimefmt":"","templateid":"0","valuemapid":"0","delay_flex":"","params":"","ipmi_sensor":"","data_type":"0","authtype":"0","username":"","password":"","publickey":"","privatekey":"","mtime":"0","flags":"0","interfaceid":"798","port":"","description":"","inventory_link":"0","lifetime":"30","snmpv3_authprotocol":"0","snmpv3_privprotocol":"0","state":"0","snmpv3_contextname":"","evaltype":"0","lastclock":"0","lastns":"0","lastvalue":"0","prevvalue":"0"}],"id":29}"
      

            Unassigned Unassigned
            Metalpegleg@hotmail.com Kurt Paulson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: