Web Reports and API

I need a way (using the API) to create/extract the “Compliance by Computer” report discussed here:

https://bigfix-wiki.hcltechsw.com/wikis/home?lang=en-us#!/wiki/BigFix%20Wiki/page/Schedulable%20Compliance%20by%20Computer%20or%20Content%20Reports%20v1.1

What is the correct approach to accomplish this? Is it possible?

Why wouldn’t you just schedule a csv export in webreports?

We have multiple customers and each customer wants multiple reports. Having bigfix send out n reports for each customer doesn’t scale. I want to be able to have 1 email sent for each customer with all n reports attached.

So here is the session relevance for that report:

<?relevance trs of htmls (unique values of (it as string) of (td of (id of computer of it as string & id of fixlet of it as string) & td of (id of computer of it as string) & td of (if exists name of computer of it then name of computer of it else "<none>") & td of (if exists operating system of computer of it then operating system of computer of it else "<none>") & td of (if exists ip addresses of computer of it then concatenations (html "<br>") of (ip addresses of computer of it as string) else html "") & td of (if exists last report time of computer of it then (((year of it as string & "/" & month of it as two digits & "/" & day_of_month of it as two digits) of date (local time zone) of it & " " & (two digit hour of it as string & ":" & two digit minute of it as string & ":" & two digit second of it as string) of time (local time zone) of it) of last report time of computer of it) else ("<none>")) & td of (if (exists first became relevant of it) then ("1") else ("0")) & td of (if (exists Last Became NonRelevant of it and not relevant flag of it) then "1" else "0") & td of (if (exists Last Became Relevant of it and Relevant Flag of it) then "1" else "0")) of results of bes fixlets) ?>

You would then use https://<bigfix_server>:52311/api/query?relevance={relevance statement}

Keep in mind that this report uses Java to perform summarization of the data resulting from the relevance query.

1 Like

Ah! I didn’t dig into it that deep.

yeah, the java is giving me problems. I run the api query and paste the results into the report but none of the java is being executed. I used this approach for some of my custom html reports and it works great. How do i deal with java?

What are you hoping to accomplish?

i want to be able to create this report using the API (along with a few others), zip them all up and send them out via email.

This and its sibling reports are designed to be interactive, which makes this challenging. Are you thinking about sending a printout of the data (PDF), or the underlying data (CSV)? What does the end-user expect to see?

HTML ideally. Columns are sortable and file size is smaller than PDF.

There are instructions in the Wiki for sending the HTML via gmail, yahoo, and local SMTP server as part of the Scheduling function in Web Reports. Perhaps this points to a solution using a customized executable. As for the API approach, perhaps someone with coding knowledge could suggest a programmatic solution.

turns out javascript wasn’t the problem… it was my fat fingers. Taking the results of the API query and dropping it into the “compliance by computer” source works just fine.

1 Like