I’m querying BigFix using the API and session relevance, but the results are taking about 1 minute to retrieve. We have about 15k endpoints (between desktops and servers) and I’m wondering if there is a way to optimize my query or if it’s just that slow.
Here is a perl script I use with the RelevanceRequest.pm file provided by IBM that takes about 55 seconds to complete:
#!/usr/bin/perl
use lib '/var/www/cgi-bin/libs';
use RelevanceRequest;
my $relRequest = new RelevanceRequest('http://my.bigfix.server/webreports', 'apiuser', 'apipass');
my $query = '(name of computer of it,values of it) of results from (bes properties whose (name of it = "IP Address")) of members of bes computer groups whose (id of it = 494)';
# my $query = '(name of it, ((concatenation " : " of values of it as string | "") of results from (bes properties whose (name of it = "IP Address")) of it)) of members of bes computer groups whose (name of it = "UNIX_COMPUTERS")';
my @computerNames = $relRequest->evalRel($query) ;
print join("\n" ,@computerNames );
print "\n";
I also have a bash script that uses the api/query?relevance=… and it also takes about the same amount of time to return results.
#!/bin/bash
ApiUrl=https://my.bigfix.server:52311/api/query
DirtyRelevance='(name of computer of it,values of it) of results from (bes properties whose (name of it = "IP Address")) of members of bes computer groups whose (id of it = 494)'
CleanRelevance=$(python -c "import urllib; print urllib.quote('''$DirtyRelevance''')")
curl -s --insecure --basic --user apiuser:apipass -G --data "relevance=$CleanRelevance" $ApiUrl
So, does anyone see any way to possibly optimize this relevance to return the results in a more timely fashion or see anything I’m just outright doing wrong?