Ad Widget

Collapse

api call not returning entire results

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • plachance
    Junior Member
    • Nov 2014
    • 3

    #1

    api call not returning entire results

    Hey !

    I am trying to get all fields of triggers with a host.get using selectTriggers with a search criteria and it only returns me the triggers->triggerid.

    Here is my query in perl :

    my $json = {
    jsonrpc=> '2.0',
    method => 'host.get',
    params => {
    groupids => [ '20 ' ],
    monitored_hosts => 'true' ,
    selectApplications => 'extend' ,
    selectMacros => 'extend' ,
    selectItems => 'extend' ,
    selectTriggers => [ searchWildcardsEnables => 'true', search => [ description => '*.m_*' ] ],
    selectInterfaces => 'extend',
    },
    id => 7,
    auth => "$l_auth",
    };

    What I need is to only get the triggers that have *.m_* in it.

    When I extract the results, I only get triggerids ... they are the good one so the search is working... but I also need the description and expression from the triggers.

    I also tried with output=>'extend' and it did not change anything...


    For those who prefer PHP , here is my PHP code:


    $hostList = $api->hostGet(
    array('groupids'=>getSieraId(),
    'monitored_hosts'=>'true',
    'selectApplications'=>'extend',
    'selectMacros'=>'extend',
    'selectItems'=>'extend',
    'selectTriggers'=>array('output'=>'extend','search WildcardsEnabled'=>'true','search'=>array('descrip tion'=>'*.m_*')),
    'selectInterfaces'=>'extend')

    );


    Please note that using this:
    $triggerList = $api->triggerGet(
    array('searchWildcardsEnabled'=>'true','search'=>a rray('description'=>'*.m_*')));

    works perfectly so I assume this is not something related to my search options...


    Thank you.
  • plachance
    Junior Member
    • Nov 2014
    • 3

    #2
    No help ?

    Nobody can help ????

    Comment

    Working...