Ad Widget

Collapse

GroupID via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ognjen
    Junior Member
    • Jan 2019
    • 23

    #1

    GroupID via API

    Can anyone help me get a group id via api. If i do below i endu p with a list of all groups and their id's, i just want to get groupid for a specific group that i pass as a group below:

    groups_id = zapi.hostgroup.get({"extend":"groupid","filter": {"name":group.split(",")}})
  • Manishk
    Junior Member
    • Apr 2019
    • 12

    #2
    Hello ognjen
    Please try below mentioned API, it will help you out to resolve your query.
    curl -s -i -X POST -H 'Content-Type: application/json-rpc' -d ' {
    "jsonrpc": "2.0",
    "method": "hostgroup.get",
    "params": {
    "output": [ "groupid"],
    "filter":{"name":["Zabbix servers"] }
    },
    "id": 1,
    "auth": "abcdesg824375998432sdh"
    }' http://xx.xy.yx.zx/zabbix/api_jsonrpc.php

    Note: you need to change IP and authentication of your zabbix server machine which is mentioned as "xx.xy.yx.zx" and "auth":"abcdesg824375998432sdh".

    Please revert me back if your query is not resolve.

    Thanks


    Last edited by Manishk; 23-08-2019, 08:47.

    Comment

    Working...