Ad Widget

Collapse

zabbix api - type query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pds
    Junior Member
    • Apr 2014
    • 11

    #1

    zabbix api - type query

    I've been experimenting with the zabbix api lately. I am wondering what the query type expects as paramater. Most of these calls begin with Select*

    cfr. https://www.zabbix.com/documentation...e/template/get.

    If any of people from zabbix itself are reading this please post more examples
  • zerotog0
    Junior Member
    • Jan 2015
    • 1

    #2
    you can check its usage here https://www.zabbix.com/documentation...ix/api/generic

    for example:
    i want only to get the name and status of hosts that belong to the group XXX,

    #!/usr/bin/python

    import ZabbixAPI

    url='http://localhost/zabbix'
    user='Admin'
    password='123456'
    groupName='XXX'
    zbx=ZabbixAPI.ZabbixAPI(url,user,password)
    zbx.login()
    params = {'selectHosts': ['name','status'],
    'filter': {'name': [groupName]}}
    obj= zbx.json_obj('hostgroup.get',params)
    result = zbx.postRequest(obj)
    print result

    Comment

    Working...