[ZBX-7454] updating inventory object API change inventory_mode status to manual (0) Created: 2013 Nov 28  Updated: 2017 May 30  Resolved: 2013 Dec 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 2.2.0
Fix Version/s: 2.2.2rc1, 2.3.0

Type: Incident report Priority: Minor
Reporter: Kodai Terashima Assignee: Ivo Kurzemnieks
Resolution: Fixed Votes: 0
Labels: api
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by Ivo Kurzemnieks [ 2013 Dec 05 ]

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

Comment by Eduards Samersovs (Inactive) [ 2013 Dec 05 ]

Tested

Comment by Ivo Kurzemnieks [ 2013 Dec 09 ]

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

Comment by Pavels Jelisejevs (Inactive) [ 2013 Dec 12 ]

(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"
}

iivs RESOLVED in r40935

jelisejev

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"
    }
}

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

RESOLVED in r40972

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

iivs REVIEWED and TESTED.
Thanks!
CLOSED.

Comment by Ivo Kurzemnieks [ 2013 Dec 14 ]

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

Generated at Fri Mar 29 00:49:05 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.