Relevance code to find out boot time of OS

I am trying to find out boot time of OS but using below syntax i am not getting it.

(IDs of it, Names of it , IP Addresses of it , Operating Systems of it, Boot Time of Operating Systems of it) of BES Computers ??

@mail2vij, we need to distinguish between Client Relevance that runs on the client side, and Session Relevance that runs on the BigFix Server side.
Your statement is mostly Session Relevance, but “boot time of operating system” is a Client Relevance.

So we need to first create a Property or Analysis that collects the boot time from the clients, before we can use it for reporting.

1 Like

You need something like this universal analysis to get the boot time from your endpoints using client relevance, then you can report on it using session relevance: https://bigfix.me/analysis/details/2998002

This analysis also has boot time: https://www.bigfix.me/analysis/details/2994800

This is the property: https://bigfix.me/relevance/details/2998648

1 Like

I have already created this property but not sure how to use this into session relevance.

@mail2vij, this is likely what you need.

(
	IDs of it, 
	Names of it, 
	concatenation "; " of (it as string) of IP Addresses of it, 
	Operating Systems of it, 
	value of results from (bes property whose (name of it = "Boot Time")) of it | "Not reported"
) of BES Computers
1 Like

Hi Lee,

Two questions here:-

  1. I am getting below error for getting the output on the command line

  2. want to take archive of custom report compliance by computer group archive at define location is it possible to take archive of that custom report with selected baseline and computer group?

    C:>curl -k --insecure --user user:passwd --data-urlencode “relevance=(value of results from
    (bes property whose (name of it = “Boot Time”)) of it | “Not reported”) of BES Computers” https://server:52311/api/query -o c:\temp\vjcomp.xml
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0curl: (6) Could not re
    solve host: Time)) of it | Not
    curl: (6) Could not resolve host: reported) of BES Computers

    <?xml version="1.0" encoding="UTF-8"?>



    ** **
    This expression could not be parsed.

@mail2vij, since you are using cURL from the command line, you need to be careful with escaping characters. Then also the characters getting through the REST API via HTTP.

Note that the double quotes need to be escaped, and the pipe character as well.

curl -k --insecure --user user:passwd --data-urlencode "relevance=(value of results from (bes property whose (name of it = ""Boot Time"")) of it %%7c ""Not reported"") of BES Computers" https://server:52311/api/query -o c:\temp\vjcomp.xml

If you are referring to the Interactive Fixlet Compliance by Computer Group report, it cannot be scheduled for archive because of the interactive nature of the report. That was the reason for the new set of Schedulable reports that can be scheduled for archive.

Ok got it , i forgot to keep quotes. Thanks

Now i am runinng below query , but when i run i get xml output Boot Time as “Not Reported” only , no value i am getting on that string.

curl -k --insecure --user user:passwd --data-urlencode "relevance=(IDs of it, Names of it, concatenation ""; "" of (it as string) of IP Addresses of it, Operating Systems of it, value of results from (bes property whose (name of it = ""Boot Time"")) of it | ""Not reported"") of BES Computers" https://pepwap07913:52311/api/query -o c:\temp\vjcomp.xml

2). Is there any other similar report which i can schedule to fetch the same output on the basis on baseline group?

Hi @leewei,could you please help on this

@mail2vij, when you run the query, do you see any computers reporting the Boot Time?
The Not Reported string is the substitution if a computer does not have values for Boot Time.
Obviously you can double check the Boot Time property in the BigFix Console.

The query current uses “BES Computers”.
If you want to limit this to a group of computers based on computer group, the Session Relevance will be something like this.

In place of:

BES Computers

Use example:

members of bes computer groups whose (name of it = "Name of Your Computer Group")
1 Like

I’d just point out that in this case “Not Reported” may not be the default result from a property the computer hasn’t reported, but may be getting returned by the pipe operator because of an error on the left side of the pipe. Something syntax related perhaps.

Looking at the screenshot earlier in the thread, there are two properties named “Boot Time”. One is Activated in Master Action Site; the other is from a Not Activated analysis. Could the presence of two properties of the same name (with one of them Not Activated) be throwing a singular/plural error?

I’d recommend you start by crafting the Session Relevance in the Console’s Presentation Debugger, or in the Web Reports QNA page first; and omit the | "Not Reported" so you can see the original error message (if there is one). Once you have a working query, then you can start working on the escape sequences to make it work from curl.

1 Like

This can easily happen if the name is duplicated. You might want it to be restricted more by activated status and the site it comes from as well

1 Like

Thanks for all replies , removed the other property value of Boot Time which was not activated and i am getting Boot Time values.

Thanks