Hello, I’m trying to get the IBM::Asset::Owner from Bigfix given a list of hostnames. Right now I am just testing for one, but for all servers it returns 0 results, although I’m pretty sure the hostname exists.
values of results from ( bes properties “Computer Name” ) of bes computers whose( name of it = “some hostname here”)
Please let me know if there’s anyplace I’m going wrong here. Thanks, Seb
I’ve been working on this all day. I was able to get a list of matching hostnames, however it takes awhile. This is the query I use, is there anyway to make it faster?
query = f"values of results from ( bes properties \"IBM::Asset::Owner\" ) of bes computers whose(name of it = \"{name}\")"
This is in python.
I should explain more - I’m actually querying for a list of hostnames, some of which may or may not exist.
Anyway, I tried it out with query = "(name of it, (value of result from (bes property \"IBM::Asset::Owner\") of it) ) of bes computers whose " where after whose is a query for each of the hostnames, and it works like a charm. Thank you so much.
In that case, you may not have been matching on the correct uppercase/lowercase for the computer name earlier.
We’d usually use something like ... of bes computers whose (name of it as lowercase = "somename" as lowercase)
That way the comparison is not case-sensitive.
Did you pluralize the relevance expression? Is it possible to have more than one value for the IBM::Asset::Owner property?
(names of it, (values of results from (bes property "IBM::Asset::Owner") of it) ) of bes computers whose (name of it as lowercase = "SOMECOMPUTER" as lowercase)
are you asking for the data one hostname at a time?
Just a note: it is possible to have multiple properties with the same name based on the analysis or site the property is a part of just like you could have the same value for a fixlet ID across your whole deployment if those fixlet IDs are in separate sites. For example, in my deployment there are 4 different properties called “Computer Type” because each of those property names are part of a different site or different analysis.
This works in my environment, whether the duplicated names are real or bogus:
(names of it, (values of results from (bes property "IBM::Asset::Owner") of it) ) of bes computers whose (name of it as lowercase = "somecomputer" as lowercase or name of it as lowercase = "SOMEOTHERCOMPUTER" as lowercase or name of it as lowercase = "SOMECOMPUTER" as lowercase)
Thanks! But what I meant was, if a name appears multiple times in BigFix itself (for example if there are 3 computers named “test_computer”), I want to ensure I’m getting them all.
Using plural relevance should get all the computers that have the same name. You may want to add the ID property to the output so you can determine which is which.
(ids of it, names of it, (values of results from (bes property "IBM::Asset::Owner") of it) ) of bes computers whose (name of it as lowercase = "somecomputer" as lowercase or name of it as lowercase = "SOMEOTHERCOMPUTER" as lowercase or name of it as lowercase = "SOMECOMPUTER" as lowercase)