Schedule BigFix export to CSV for ServiceNow

Hi Guys,

I am trying to figure out as way to export data from BigFix into a csv file on a network share as a schedule task.

So far I have been able to fetch all the required data using BigFix Excel connector and save it as a CSV file but I am at a dead end with trying to find a way to run this as a scheduled task on a weekly basis which would rename the old file and place the new CSV in the same location.

I am not very familiar at writing a code to use REST or SOAP and would really appreciate if you can help me out with trying to find a simpler way to do accomplish this task.

The export is for ServiceNow to import the data form the CSV file into its CMDB from an FTP share where I am trying to save the CSV file.

The query I ran using the Excel Connector is exporting below mentioned fields:

bes property “Computer Name”,
bes property whose (name of it = “OS” and
(item 0 of it = 2299646071 and item 1 of it = 5 and item 2 of it = 1) of id of it),
bes property “Active Directory Path”,
bes property “Domain/Workgroup - Windows”,
bes property “DNS Name”,
bes property “IP Address”,
bes property “Subnet Address”,
bes property whose (name of it = “User Name” and
(item 0 of it = 2299646071 and item 1 of it = 27 and item 2 of it = 1) of id of it),
bes property whose (name of it = “Computer Type” and
(item 0 of it = 2299646071 and item 1 of it = 147272 and item 2 of it = 5) of id of it),
bes property “Device Type”,
bes property “MAC Addresses - Windows”,
bes property “CPU”,
bes property “Brand String of CPU - Windows”,
bes property whose (name of it = “x64” and
(item 0 of it = 8361 and item 1 of it = 34 and item 2 of it = 4) of id of it),
bes property “RAM”,
bes property “Total Size of System Drive”,
bes property “Free Space on System Drive”,
bes property whose (name of it = “Disk Partitions” and
(item 0 of it = 8361 and item 1 of it = 23 and item 2 of it = 1) of id of it),
bes property “Computer Manufacturer - Windows”,
bes property “Computer Model - Windows”,
bes property “Disk Drives - Windows”,
bes property “IDE/SATA Devices - Windows”,
bes property “Identifying Number - Windows”,
bes property “Network Adapter - Windows”,
bes property “Number of Fixed Drives - Windows”,
bes property “Number of Processors - Windows”,
bes property “Number of Processor Cores - Windows”,
bes property “SCSI Devices - Windows”,
bes property “Connected USB Devices - Windows”,
bes property “Symantec Endpoint Protection Client Version”)

I also checked the BFExtractToCSV utility but was unable to generate a similar query in the correct syntax.

Thanks for your help guys!

@leewei @jgstew @Aram @TimRice @AlanM @JasonWalker - any idea how to get around this one guys ???

Thanks

There are a number of ways you might be able to achieve this actually, some of which are listed below.

  1. Web Reports - through Scheduled Activities, you can export a custom report to CSV. However, all archived reports through Scheduled Activities are written to the same general path (which is configurable to be on a network share, but this would affect all Scheduled Activities, and so, likely not desirable)
  2. BFExtractToCSV tool should work with the correct syntax
  3. Can invoke the REST API fairly easily with the BigFix CLI ( https://www.ibm.com/support/knowledgecenter/SSQL82_9.5.0/com.ibm.bigfix.doc/Platform/Config/c_iem_cli_overview.html ) or via utilities such as cURL ( https://github.com/bigfix/restapi-examples/tree/master/evaluate-relevance/cURL ), and have it export the resulting XML to a file.

Note that you’ll likely have to encode the above session relevance (particularly the double-quotes) in some cases if including the session relevance as an argument in the command line for instance.

Can you provide more details around how you invoked the BFExtractToCSV tool, and what issues you ran into?

I copied cmd.exe to C:\Program Files (x86)\BigFix Enterprise\BES Server\BESReportsData\CustomExe on the Web Reports server and create Scheduled Activities for the reports I want to export and use the Customized Executable: selecting cmd.exe and then enter
/C copy /Y <reportfile> "path\filename.csv"

<reportfile> represents the generated report, substitute a fully qualified path and filename as the target for the copy. Thanks to Jason for providing the code tags for above.

1 Like

Thanks for the tip! I added code tags to your post so the tags are visible now.