Ad Widget

Collapse

Zabbix API. Item.get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanchezz
    Junior Member
    • Nov 2015
    • 4

    #1

    Zabbix API. Item.get

    Hi all!
    Please help.
    How correctly retrieve item by name, if name contains "CPU $2 time" construction and key is "system.cpu.util[,idle]".

    Full item name is "CPU idle time"

    If i try to search only with name or _key fields, of course it returns empty array..
    For example I tried:
    PHP Code:
    "search": {
                
    "key_""CPU idle time"
    }

    or

    "search": {
                
    "key_""idle"
    }

    or

    "search": {
                
    "name""CPU idle time"

    So I need to get an item when i pass full name..

    Please give advise how correctly done this..
    Thanks.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    You can use wildcard.

    ex.
    Code:
    {
    	"jsonrpc": "2.0",
    	"method": "item.get",
    	"params": {
    		"output": "extend",
    		"hostids": "10084",
    		"search": {
    			"key_": "system.cpu.util*idle*"
    		},
    		"searchWildcardsEnabled": "true"
    	},
    	"auth": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    	"id": 1
    }

    Comment

    Working...