Ad Widget

Collapse

Zabbix API: get hosts in hostgroup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #1

    Zabbix API: get hosts in hostgroup

    Hi,
    I'm doing some work with the zabbix api and need to find the hostids of all hosts within a hostgroup. The query I'm running is returning the hostid of every host in the server. Has anyone done this before?

    The query I'm using is this:

    ZabbixAPI::fetch_array('host','get',array(
    'output'=>'shorten',
    'select_groups'=>'shorten',
    'filter'=>array(
    'groupids'=>array(
    $hostgroupid)
    )
    )
    )

    I'm usig the php api. What the code is trying to do if find any host with a hostgroup id matching a passed value. Would appreciate any advice on what I'm missing here...


    Regards,
    David
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #2
    Hi,
    I've resolved this by removing the filter option.


    Regards,
    David

    Comment

    Working...