ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7454

updating inventory object API change inventory_mode status to manual (0)

    Details

    • Type: Incident report Incident report
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.2rc1, 2.3.0
    • Component/s: API (A)
    • Labels:

      Description

      How to reproduce:

      1. change inventory mode to automatic from frontend or API
      2. execute this API call

      {"jsonrpc":"2.0","method":"host.update","params":{"hostid":"10084","inventory":{"type":"1"}},"auth":"7ab185693c686165752a33df2afe143b","id":1}

      3. back to frontend, inventory mode is changed to manual

      I think updating inventory object should not touch inventory mode setting.

        Activity

        Hide
        Ivo Kurzemnieks added a comment -

        RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-7454

        Show
        Ivo Kurzemnieks added a comment - RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-7454
        Hide
        Eduards Samersovs (Inactive) added a comment -

        Tested

        Show
        Eduards Samersovs (Inactive) added a comment - Tested
        Hide
        Ivo Kurzemnieks added a comment -

        Fixed in pre-2.2.2rc1 r40835 and pre-2.3.0 (trunk) r40836

        Show
        Ivo Kurzemnieks added a comment - Fixed in pre-2.2.2rc1 r40835 and pre-2.3.0 (trunk) r40836
        Hide
        Pavels Jelisejevs (Inactive) added a comment - - edited

        (1) Found a problem. I have two hosts, one with inventory mode set to manual, one - to automatic. When I perform a host.massupdate request to change their inventory "type" field, the inventory mode for both hosts is set to automatic.

        Here's the request I use:

        {
            "jsonrpc": "2.0",
            "method": "host.massupdate",
            "params": {
                "hosts": [
                    {
                        "hostid": "10127"
                    },
                    {
                        "hostid": "10171"
                    }
                ],
                "inventory": {
                    "type": "test"
                }
            },
            "id": 2,
            "auth": "a0681736f940be86d0ac5907a2a04f75"
        }
        

        Ivo Kurzemnieks RESOLVED in r40935

        Pavels Jelisejevs

        1. You forgot to remove the debug code before committing.
        2. It is now possible to update host inventory fields for hosts with inventory mode set to automatic when omitting the "inventory_mode" parameter. For example, with the following request:

        {
            "hosts": [
                {
                    "hostid": "10158"
                }
            ],
            "inventory": {
                "os": "test3322222222221111"
            }
        }
        

        Ivo Kurzemnieks
        1. Oops, really sorry about that;
        2. Sorry, I understood this wrong before.

        RESOLVED in r40972

        Pavels Jelisejevs I've made the changes we've discussed in r41001. Please review.

        Ivo Kurzemnieks REVIEWED and TESTED.
        Thanks!
        CLOSED.

        Show
        Pavels Jelisejevs (Inactive) added a comment - - edited (1) Found a problem. I have two hosts, one with inventory mode set to manual, one - to automatic. When I perform a host.massupdate request to change their inventory "type" field, the inventory mode for both hosts is set to automatic. Here's the request I use: { "jsonrpc" : "2.0" , "method" : "host.massupdate" , "params" : { "hosts" : [ { "hostid" : "10127" }, { "hostid" : "10171" } ], "inventory" : { "type" : "test" } }, "id" : 2, "auth" : "a0681736f940be86d0ac5907a2a04f75" } Ivo Kurzemnieks RESOLVED in r40935 Pavels Jelisejevs 1. You forgot to remove the debug code before committing. 2. It is now possible to update host inventory fields for hosts with inventory mode set to automatic when omitting the "inventory_mode" parameter. For example, with the following request: { "hosts" : [ { "hostid" : "10158" } ], "inventory" : { "os" : "test3322222222221111" } } Ivo Kurzemnieks 1. Oops, really sorry about that; 2. Sorry, I understood this wrong before. RESOLVED in r40972 Pavels Jelisejevs I've made the changes we've discussed in r41001. Please review. Ivo Kurzemnieks REVIEWED and TESTED. Thanks! CLOSED.
        Hide
        Ivo Kurzemnieks added a comment -

        Fixed in pre-2.2.2rc1 r41003 and pre-2.3.0 (trunk) r41004

        Show
        Ivo Kurzemnieks added a comment - Fixed in pre-2.2.2rc1 r41003 and pre-2.3.0 (trunk) r41004

          People

          • Assignee:
            Ivo Kurzemnieks
            Reporter:
            Kodai Terashima
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: