Ad Widget

Collapse

Get the list of hosts of the parent group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SyDemon
    Junior Member
    • Jun 2016
    • 6

    #1

    Get the list of hosts of the parent group

    Hello.
    I use the following device distribution scheme for the groups:

    Click image for larger version

Name:	1.png
Views:	537
Size:	5.6 KB
ID:	358479


    I need to build a pie chart showing the ratio of the devices in the ALL/GrA and ALL/GrB groups.
    For this purpose I use API to get ZABBIX server data by running the following script:

    hosts()
    {
    JSON='
    {
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
    "output": [
    "hostid ",
    "host"
    ],
    "groupids": '23'
    },
    "auth": "'$TOKEN'",
    "id": 1
    }

    If I specify the ID of the ALL / GrA / R1 group in the query, I get the list of the hosts this group contains. If I specify the group ID of ALL / GrA, an empty value is returned.
    Is this a bug or am I doing something wrong?
  • SyDemon
    Junior Member
    • Jun 2016
    • 6

    #2
    For some reason, my post is not visible to all...

    Comment

    Working...