Get Service Status Via API using relevance

Hi There,

I’m trying to get the state and start up of type of BESClient service in all flavors of clients reporting to Bigfix TEM server using relevance in REST API.

Any help is appreciated.

I think some clarification may be needed here.

Start Up Type of a service (if I’m understanding what you’re asking for) is generally a Windows concept, and does not apply to most other flavors/platforms. Also, the state of the BigFix Client service itself cannot be reliably returned by a REST call to the BigFix Server (since the Server won’t really have the current state of the Client if the Client service is not running).

One potential approach for the ‘state’ of the Client service might be to return all computers that haven’t reported in within the last X amount of time (such as 1 day):

(id of it, name of it) of bes computers whose (last report time of it < (now - 1 * day))

or

/api/query?relevance=(id%20of%20it,%20name%20of%20it)%20of%20bes%20computers%20whose%20(last%20report%20time%20of%20it%20<%20(now%20-%201%20*%20day))

I understood the concern. Sorry for the confusion. I want to retrieve the start up type and state of BESClient for windows clients who are actively reporting via REST API.

Hi There,

Can anyone help on this.

I think unfortunately there is still some confusion. If you are looking to query the BigFix Platform’s REST API for the state of the BESClient service on Windows machines who are actively reporting, then the state will always be running :slight_smile:

That said, here is a sample bit of Client relevance that can be used in a custom property/analysis to return the requested data:

(start type of it, state of it) of service "besclient"

You can then query the REST API for the data from this custom property (the below samples assume you name it “BigFix Client Status (Windows)”).

Here’s a sample session relevance query:

(name of it, values of results from (bes properties "BigFix Client Status (Windows)") of it) of bes computers

And here is a sample call to the query resource of the REST API (url-encoded):

/api/query?relevance=(name%20of%20it,%20values%20of%20results%20from%20(bes%20properties%20"BigFix%20Client%20Status%20(Windows)")%20of%20it)%20of%20bes%20computers

2 Likes

By running this query, I’m able to get the start up type in console. Thanks for the support.