Ad Widget

Collapse

zapi.template.get vs zapi.do_request('template.get'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zablux01
    Junior Member
    • Mar 2018
    • 4

    #1

    zapi.template.get vs zapi.do_request('template.get'

    Hello

    Do you understand this ?

    #!/usr/bin/env python
    import json
    from pyzabbix import ZabbixAPI, ZabbixAPIException

    zapi.login(user = myusr,password = mypwd)

    t = zapi.do_request('template.get', {"output": "templateid", "filter": { "name": "Test" }})
    print t
    < print one single row corresponding to the selected template>


    #!/usr/bin/env python
    import json
    from pyzabbix import ZabbixAPI, ZabbixAPIException

    zapi.login(user = myusr,password = mypwd)

    t = zapi.template.get({"output": " templateid", "filter": { "name": "Test" }})
    print t
    < print all the rows corresponding to all templates, looks like the filter is not working>
Working...