N
N
Nikolay Baranenko2017-12-18 10:56:58
Zabbix
Nikolay Baranenko, 2017-12-18 10:56:58

Is it possible to get values ​​from the keys sheet?

Hello.
There is a desire to receive several values ​​​​at once using one Zabbix API request
search by one key - ok

zabbix_get= \
        {
            "jsonrpc": "2.0",
            "method": "item.get",
            "params": {
                "output": "extend",
                "host": 'server01',
                "search": {
                    "key_": 'vfs.fs.size[/data,free]'
                },
                "sortfield": "name"
            },
            "auth": authToken.get("result"),
            "id": authToken.get("id")
        }

how to correctly pass information for the example
'vfs.fs.size[/data,free]','system.cpu.util.usage'
so that one request returns information on two metrics at once?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2017-12-18
@drno-reg

Hello.
To search for multiple exact values, try using filter (works like item.key = '...' in a database).
To search for multiple wildcard values ​​(using wildcard) use search (works like item.key LIKE '%...%' in a database).
To search for multiple values, use a JSON array :

zabbix_get= \
        {
            "jsonrpc": "2.0",
            "method": "item.get",
            "params": {
                "output": "extend",
                "host": 'server01',
                "filter": {
                    "key_": [
                        "vfs.fs.size[/data,free]",
                        "system.cpu.util.usage"
                    ]
                },
                "sortfield": "name"
            },
            "auth": authToken.get("result"),
            "id": authToken.get("id")
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question