Ad Widget

Collapse

API::Item()->get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pc99096
    Senior Member
    • Oct 2011
    • 193

    #1

    API::Item()->get

    anyone familiar with the function below?

    $items = API::Item()->get(array(

    'hostids' => array_keys($hosts),
    'output' => array('itemid', 'name', 'value_type', 'units', 'hostid', 'state', 'key_'),
    'selectApplications' => array('applicationid'),
    'preservekeys' => true
    ));



    is there any way to get only specific items (like for example "agent ping")? this function gets all possible items from the db, which is quite time consuming.
  • tsalle
    Member
    Zabbix Certified Specialist
    • Oct 2012
    • 79

    #2
    You can add search filters :
    search => array ( 'key_' => 'agent.ping' )

    Comment

    • pc99096
      Senior Member
      • Oct 2011
      • 193

      #3
      great, thanks!

      is there a way to include 2 items at once?

      sorry, i am not very good in php, but
      search' => array ( 'key_' => array('agent.ping', 'system.hostname') )
      doesn't seem to work

      Comment

      Working...