If you want the list of Relays/Root and their status, then this works. However, when using these queries in the API like you’re doing, I’ve found success with url encoding the session relevance from a site like https://www.urlencoder.org and then using it in your https://MainBigFixServer:52311/api/query?relevance=< session relevance >
(name of it, value of result from (bes property "BES Relay Service Installed") of it) of bes computers whose (relay server flag of it or root server flag of it)
1st thing is why you want to get results using API, if you just need this info you can get it from console or directly from Webreport simply, moreover you can also schedule that report to your email Ids and webreport will give you more option to add whatever other required RP/column info you want to get with that.
In testing the REST query, the results are inconsistent, I’ve seen it miss between 1 and 30 agents per execution.
https://123:52311/api/query?relevance=(IDs of it , Names of it , Relay Server Flags of it , Operating Systems of it , Last Report Times of it, Relay Selection Method of it) of bes computers whose (agent type of it = “Native”)
The following results were generated executing requests back-to-back to avoid any potential differences due to timing:
First Execution output :- 54568
Second Execution output :- 54572
Third Execution output :- 54532
Please suggest why servers counts are mis-matching between each execution ?
That adds handling for duplicates properties, missing results for a property, etc.
In that form you can compare the results between queries to see which machines are being added, removed, or missing results, and possibly identify issues in your environment.
Issue which I noticed in below API call is when I add Relay Server Flags of it that time Count of Server is mismatching per execution but without having Relay Server Flags of it in below API query server count always remains Same.
https://123:52311/api/query?relevance=(IDs of it , Names of it , Relay Server Flags of it , Operating Systems of it , Last Report Times of it, Relay Selection Method of it) of bes computers whose (agent type of it = "Native")
So, do I need to mention the Relay property in different format ?
This should represent the maximum number of devices you should get in the results:
number of bes computers whose (agent type of it = "Native")
This would be to get the results from only Relays, not other clients:
number of bes computers whose (agent type of it = "Native" AND Relay Server Flag of it)
I think this is what @JasonWalker is suggesting you try:
(id of it as string | "UnknownID", name of it | "UnknownName", operating system of it | "UnknownOS", last report time of it as string | "UnknownLastReport", relay selection method of it | "UnknownRelayMethod") of bes computers whose (agent type of it = "Native" AND Relay Server Flag of it)
Something like this is required, because otherwise any computer who is lacking one of the things being queried will be silently removed from the results when using plural session relevance. This can be a good thing for efficiency reasons, but a bad thing if you are trying to include all possible items.
Basically I need all Server information along with Relay Flag entry. So, that anyone can identify from same report on x Server Client is installed and on y Server Client and Relay both are installed.