Connection from SAP to BigFix Environment: REST API or CLI?

Hi Guys

I think the question is clear, but some more information:
We are using SAP programs and they need to get the ID’s of some devices.

Do I need to use the REST API or the CLI? Those are different queries (escaping quotes etc), so it’s important to know.

And is there any information available for that?

Thank you and greetings.

For machine to machine I’d say REST API but depends what the client (SAP) capabilities are.

Yeah well, that’s what I thought too. IBM support couldn’t give an exclusive answer, so still looking for that. But thanks for the answer!

I’m not sure you could get a definitive answer from support - both are valid approaches.

1 Like

The CLI is really just a “wrapper” for the REST API, so, as suggested, either approach is valid, and the chosen path depends more on the external system interfacing with BigFix.

Will they be querying for the Computer IDs of specific computers (by name?), or some other approach?

Hi @Aram

The goal of the program is to get the device ID with a relevance query and then trigger an action to that device id.

We use “id of bes computers (whose name of it = “x”)”.

It worked before, but suddently not anymore. So Support said to escape the quotes with backslash (CLI query), but that didn’t work…

It may have something to do with the REST API not working a 100% (see post: REST API won't work in IE11, but does in FireFox/Chrome ).

Thanks for the answer.

There’s a typo in that relevance that will fail if there’s more than one computer, you need to use a the plural: ids of bes computers ...

Thanks for the answer. We always have only 1 computer with that name, so it’s not a problem.

1 Like

When you say it is suddenly not working anymore, is there an error that is being returned?

I see two potential issues:

  1. the ‘whose’ portion of the relevance above should be before the parenthesis
  2. depending on how you’re invoking the REST API, you’ll likely want to encode the double-quotes

As a test, I just successfully ran the following:

iem get /api/query --relevance="ids of bes computers whose (name of it = %22BIGFIX%22)"

Hi

I did misplace the ‘whose’ in this example, but in SAP it’s correct. I’ll test the %22 when i’m back in the office (currently in Rome for the IBM Security Group).

Looks like that is particular to IE and this APAR

1 Like