Installed Software report via Rest API

i have to generate a report against all installed software in windows server via rest api connection , for this i would use curl.
can someone plz assist me on this

Thanks

do you have an analysis for the software installed already?

Or are you running BFI and running software scans?

i have an analysis for the installed software , but want to use the relevance query to get the data in xml format

OK then, that makes it easy. Here’s a good resource on how the RESTAPI works.
https://developer.bigfix.com/rest-api/api/query.html

If you have your query already, you can use a simple get in the URL to test, or use the post method. I like the post method b/c there is no limit to the size of the query:

curl -k -u un:pw -d 'relevance=names of bes computers' https://server.domain.com:52311/api/query

1 Like

Thanks for your help, i am using the below query but not getting the desired result

curl -v -k --insecure --user Admin:password --data-urlencode “relevance=(name of computer of it) of results of bes properties whose (name of it contains ““Installed Applications - Windows”” and name of source analysis of it = ““Application Information (Windows)””)” https://server1:52311/api/query

Two things, the quotation marks were the MS pretty version, not the literal " ones. Your command could choke on that. Also, you may want to try using the escape \ character in your cure.

Try this:
curl -v -k --insecure --user Admin:password --data-urlencode "relevance=(name of computer of it) of results of bes properties whose (name of it contains \"Installed Applications - Windows\" and name of source analysis of it = \"Application Information (Windows)\")" https://server1:52311/api/query

1 Like

Using single quotes:

curl -v -k --insecure --user Admin:password --data-urlencode 'relevance=(name of computer of it) of results of bes properties whose (name of it contains "Installed Applications - Windows" and name of source analysis of it = "Application Information (Windows)")' https://server1:52311/api/query

1 Like

the last query which you mentioned is not working

app.xml

  • Rebuilt URL to: of/
    % Total % Received % Xferd Average Speed Time Time Time Curren
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
    Could not resolve host: of
  • Closing connection 0
    curl: (6) Could not resolve host: of
  • Rebuilt URL to: computer/
  • Could not resolve host: computer
  • Closing connection 1
    curl: (6) Could not resolve host: computer
  • Rebuilt URL to: of/
  • Could not resolve host: of
  • Closing connection 2
    curl: (6) Could not resolve host: of
  • Rebuilt URL to: it)/
  • Could not resolve host: it)
  • Closing connection 3
    curl: (6) Could not resolve host: it)
  • Rebuilt URL to: of/

[quote=“masonje, post:6, topic:25371”]

the above query is working but getting the host name only , want to get the application name as well

Hi @masonje, any help on this?

Sorry, not the best at relevance… but:

(
  names of it, 
  values whose(it as string as lowercase contains "Application Information (Windows)" as lowercase ) of results from (bes property "Installed Applications - Windows" ) of it 
)
of (members of bes computer groups whose (name of it = "Windows Servers") )

I added in the group part because it helps the query run faster. Limits who your asking the question of. If you want you could just make it just “BES Computers” if you want.

1 Like

Hi @masonje,

Looks like query is good , but i am not getting any result of it , and showing me result item ‘0’

You need to modify the query to match a computer group that exists in your deployment. This was just an example.

i have 2 computers into the desired group. but output it still ‘zero’

(names of it, values whose(it as string as lowercase contains “Application Information (Windows)” as lowercase) of results from (bes property “Installed Applications - Windows” ) of it) of (members of bes computer groups whose (name of it = “Windows Servers”))

Well… I can only speculate at this point. That query works with some of my analyses with multi-line results.

What are the exact names of your analysis result names? What software are you looking for? Are you looking for a line of each software package of all packages installed?

Validate spelling and lower/uppercase (where applicable) words.

This query works fine for me in general:
image

1 Like

when i execute the sample query i got the result but not getting result for application installed

intention is to get Server name with all windows application installed for each server in group

As I mentioned, validate the BES Property/analisis name in the query. I doubt your inventory exists in “Downloaded Files” analisis results. That analisis is for the relay cache downloads and is a standard analisis. I was just showing that the query syntax works.

So it sounds like you want all of the results from your software analisis. So we can clean it up a bit and remove the “whose(…)” part of it.

(
  names of it, 
  values of results from (bes property "Installed Applications - Windows" ) of it 
)
of (members of bes computer groups whose (name of it = "Windows Servers") )

If that doesn’t give you a result, you need to check the spelling and/or name of your analisis.

1 Like

Hi @masonje

That is what i was looking for , thanks for your great help…

thank You

1 Like