Daily reports on failed data imports

Is there a way to create a scheduled report that will send out an email when data imports fail on compliance and inventory servers? Can this information be retrieved from web reports ?

Thx

Hi @Jabawonga - you raised an interesting question. Here’s what I did for BF Inventory in my environment. Let me know if it works in yours, as I tried to keep it generalized. You should be able to do something similar for BF Compliance.

First, create an Analysis with the following properties:

Import Succeeded
if (windows of operating system) then (exists files whose (name of it contains (((year of it as string & "_" & month of it as two digits & "_" & day_of_month of it as two digits) of date ("PDT" as time zone) of it) of now) and exists line containing "Import succeeded" of it) of folder ((value of settings whose (name of it starts with "SUA_Server_Path") of client) & "\wlp\usr\servers\server1\logs\imports")) else (exists files whose (name of it contains (((year of it as string & "_" & month of it as two digits & "_" & day_of_month of it as two digits) of date ("PDT" as time zone) of it) of now) and exists line containing "Import succeeded" of it) of folder ((value of settings whose (name of it starts with "SUA_Server_Path") of client) & "/wlp/usr/servers/server1/logs/imports"))

Last Lines of the Log Files
if (windows of operating system) then ((names of it, lines (integers in (number of lines of it - 2,number of lines of it)) of it) of files whose (name of it contains (((year of it as string & "_" & month of it as two digits & "_" & day_of_month of it as two digits) of date ("PDT" as time zone) of it) of now) and exists line containing "Import succeeded" of it) of folder ((value of settings whose (name of it starts with "SUA_Server_Path") of client) & "\wlp\usr\servers\server1\logs\imports")) else ((names of it, lines (integers in (number of lines of it - 2,number of lines of it)) of it) of files whose (name of it contains (((year of it as string & "_" & month of it as two digits & "_" & day_of_month of it as two digits) of date ("PDT" as time zone) of it) of now) and exists line containing "Import succeeded" of it) of folder ((value of settings whose (name of it starts with "SUA_Server_Path") of client) & "/wlp/usr/servers/server1/logs/imports"))

I called my analysis BFI Import Monitor. The period of these properties probably doesn’t need to be more than once per hour. If your import runs at midnight, you’ll get the report within an hour or so of the import failing. Also note, you may need to replace the timezone “PDT” with yours.

Relevance
(exists settings whose (name of it starts with "SUA_Server_Path" AND ((exists folder (value of it & "/properties/version") AND exists files of folder (value of it & "/properties/version")) OR (exists folder (value of it & "/iso-swid") AND exists files of folder (value of it & "/iso-swid")))) of client)

The relevance of my Analysis is based on the OOB Analysis: Environment Information in order to limit the reach of these properties to the proper server. Next, create a Computer Report in Web Reports with the following filter:

[Computer] [Import Succeeded (BFI Import Monitor)] [is ] [False ]

This should result in “No records found,” assuming your last Import was successful. Save this report, and give it a name. Finally, create a Scheduled Activity in Web Reports. The schedule should be based on your import

Type: [Report] [name of your report]
Format: HTML or PDF

Activity Triggers: Generate report every [30] [Minutes] (1/2 of the properties evaluation period)
Match Relevance conditions: Checked
Generate report when answer changes: Selected
Send email/store archive only when report has changed: Checked
Include trigger information: Checked

Activity Actions:
Email: Checked
insert your information into the relevant fields
Include report output: Checked
Include link to current report: Checked

3 Likes

Hi @itsmpro92, I was hoping there was a prebuilt one but figured I would have to do it your way. Thank you for details. On another note, do you know if its possible to combine several reports and have them sent out as one ?

Thx