Ad Widget

Collapse

Zabbix API 1.8 -> host.get method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • s12k34
    Junior Member
    • Jan 2011
    • 13

    #1

    Zabbix API 1.8 -> host.get method

    Hi,
    When I want to get the information of host with 192.171.44.145 ip, Zabbix API returns more than one records. One of the record is expected result but others are not. What should I do for correct search or is the host.get working correctly in API version 1.1? (apiinfo.version returns "result=1.1")
    Note: I don't want to use limit=1 option to get only one record.

    Thanks...

    Code:
    {
    "jsonrpc":"2.0",
    "method":"host.get",
    "params":{
        "output":"extend",
    	"filter":{
            		"ip":"192.171.44.145"
            }
        },
    "auth":"6cbe0ddab3e9095877d11507d3fdb4af",
    "id":1
    }
    response:

    Code:
    {"jsonrpc":"2.0","result":[
    {"hostid":"10761","proxy_hostid":"0","host":"192.171.44.145","dns":"","useip":"1","ip":"192.171.44.145",...},
    {"hostid":"10760","proxy_hostid":"0","host":"192.171.44.144","dns":"","useip":"1","ip":"192.171.44.144",...},
    {"hostid":"10759","proxy_hostid":"0","host":"192.171.44.143","dns":"","useip":"1","ip":"192.171.44.143",...},
    {"hostid":"10758","proxy_hostid":"0","host":"192.171.44.142","dns":"","useip":"1","ip":"192.171.44.142",...},
    ........
    ........
    ........
    ],"id":1}
    Last edited by s12k34; 01-02-2011, 02:18. Reason: mistake in text
Working...