How to get computer details with custom property?

Hi ,

In my bigfix serever, we have added a custom field with name client_id .

So I want to get the list of computers with custom property client_id . I want to use bigfix relevance query api but it’s not working.

query = %{ (
item 0 of it as string & “@$@” &
item 1 of it as string & “@$@” &
item 2 of it as string & “@$@” &
item 3 of it as string & "@$@"
of (
id of it as string | “”,
name of it as string | “”,
hostname of it as string | “”,
Client_Id of it as string | “”
)
of (bes computers, bes property “Client_Id”)
}

Please help me with above.

Thanks,
hare

In your example above, you try to return 'Client_Id of it', but that is not a property of any object. Additionally, the 'it' in 'Client_Id of it' is referring to a tuple, and so you’d typically have to reference a particular item within the tuple.

Using the approach you have above, try the following:

(item 0 of it as string & “@$@” & item 1 of it as string & “@$@” & item 2 of it as string & “@$@” & item 3 of it as string & “@$@”) of (id of item 0 of it as string | “”, name of item 0 of it as string | “”, hostname of item 0 of it as string | “”, value of result (item 0 of it, item 1 of it) as string | “”) of (bes computers, bes property “Client_Id”)

Note that the primary differences are that when we ask for ID, name, and hostname, we reference item 0 of the tuple (bes computers), and then we ask for the value of result from the property (item 1).

To help build such session relevance, you might consider leveraging the Query Wizard of the Excel Connector:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Excel%20Connector

(which is what the above relevance appears to be based on to begin with)

And in case you haven’t seen them, the following resources might be useful:

General relevance tutorial (applies to session relevance as well): https://developer.bigfix.com/relevance/tutorial.html

Session relevance guide: https://developer.bigfix.com/relevance/guide/session/

1 Like

Start by getting the individual values with session relevance for an individual computer, then with all computers, and go from there. It is always best to start simple.

Also, I would recommend using the Presentation Debugger, the Session Relevance Tester, WebReports QnA or similar tools to actually write the Session Relevance query before using it with the REST API directly.

See here: Values of property by computer name

1 Like