I’ve written a session relevance query to return the version of the BigFix server, and it work on my test setup, but is not returning anything on a customers system (which I do not have direct access to test on).
The query is:
(name of property of it & " " & value of it & " on " & name of computer of it) of (results of (properties of (BES Fixlets whose (analysis flag of it and name of it = "BES Component Versions"))) whose (name of it = "BES Server Version")) whose (value of it != "Not Installed")
Can anyone suggest either how to improve this query, or provide a better solution for returning the server version(s).
I’m calling the query through the API (both SOAP and REST) if that makes a difference.
Try adding a couple of existence checks for results and values:
(name of property of it & " " & value of it & " on " & name of computer of it) of (results of (properties of (BES Fixlets whose (analysis flag of it and name of it = "BES Component Versions"))) whose (exists results of it and name of it = "BES Server Version")) whose (exists value of it and value of it != "Not Installed")
@BigFixNinja the query is wrapped in a C# app which is executing the query via the SOAP API (also works with the REST API). For me it returns the same result as when I run it in the Presentation Debugger, while for them, no results are returned. But their system is far more complex than mine, covering 80,000+ client devices, and I do not have access to it, I can only ask my contact to run my app against their SOAP API.
@steve Thanks Steve, I’ll give this a try. For me your amended query produces the same result as my original script (which is good), so I’ll try this against the customers system.
I prefer to write the relevance so that it flows logically from right to left. Also, if using plural relevance, then you don’t have to check for existence:
(name of property of it & " " & value of it & " on " & name of computer of it) of results whose (value of it != "Not Installed") of properties whose(name of it = "BES Server Version") of bes fixlets whose(analysis flag of it and name of it = "BES Component Versions")