Create Computer report with Fixlet Severity

(imported topic written by SystemAdmin)

Hi there,

I’m looking to create a simple report that exports as follows :

Computer | Critical | Important | Moderate | Low |

Comp1 4 7 4 0

Comp2 2 0 5 2

Is this possible? I know I can list the Computer name and the amount of relevant fixlets, but I don’t seem to be able to then split the fixlets into thier severity.

Many thanks…

Craig

(imported comment written by jessewk)

Here is some code you can paste into a custom report in Web Reports 6.0.

You may find that it takes a little while to run in a large deployment. You will also likely want to sort the tables, or refine it only include fixlets from particular sites, or only a subset of computers. If you have any trouble modifiying the code to do any of those things, let us know.

<?relevance trs of (td of name of it & td of (number of relevant fixlets whose (source severity of it as lowercase = "critical") of it as string) & td of (number of relevant fixlets whose (source severity of it as lowercase = "important") of it as string) & td of (number of relevant fixlets whose (source severity of it as lowercase = "moderate") of it as string) & td of (number of relevant fixlets whose (source severity of it as lowercase = "low") of it as string)) of bes computers ?>
Computer Name Critical Important Moderate Low

p.s. I like to plug in this javascript library to make my tables sortable: http://kryogenix.org/code/browser/sorttable/

(imported comment written by BenKus)

I like this report. Here is an example of the output:

Computer Name Critical Important Moderate Low

INFINITEMONKEYS 0 2 3 6

SUPPORT3 6 6 3 6

YOUR-4DACD0EA75 0 3 0 10

D13SZNB1 1 8 1 6

(imported comment written by SystemAdmin)

Excellent. Thanks for the help guys, I’ll give that a go.

Cheers,

Craig

(imported comment written by Bjowah91)

Just brilliant!

/Thanks Björn

(imported comment written by Bjowah91)

what steps do I need to take to make the tables sortable?

I got the sortable.js but don’t no where to put it or how to modify the code to make it work.

could someone put me on the right track?

/Björn

(imported comment written by rharmer91)

This is very nice. Something that should be added to the base product or as an addon.

Rich

(imported comment written by SystemAdmin)

Hi again,

Great report, thanks for the code. I am however, having problems sorting them into a more structured format. At the moment we have an automatic group that groups any computer within a certain OU and it would be ideal to be able to add this as a column in the report.

Is this possible at all? When I used our “group computer” filter, it didn’t make any difference to the report. I looked at adding this as code but couldn’t see the correct commands for this.

Can you help?

Thanks again,

Craig

(imported comment written by jessewk)

Bjowah

what steps do I need to take to make the tables sortable?

There are 2 basic steps:

  1. Load the sorting code

a. There are 2 ways to do this.

  1. You can paste the contents of sorttable.js at the bottom of code for the report, enclosed in tags.

  2. You can link the file in from an external location. This is the way I prefer so that I can include the script in multiple reports. Add this tag at the top of the report:

You will then need to add the sorttables.js file to the specified path. In this example, you would place the file at the root of the web reports server. By default:

C:\Program Files\BigFix Enterprise\BES Server\BESReportsServer\wwwroot\sorttables.js

  1. Tag the tables you’d like to make sortable

a. Set the class for your table to “sortable”:

b. Give your table a unique ID:

Here’s a final version that will work if you place the sorttable.js file in the location I specified above:

<script type=
"text/javascript" src=
"../../sorttable.js"></script> <table class=
"sortable" id=
"results_table"> <tbody> <tr><th>Computer Name</th><th>Critical</th><th>Important</th><th>Moderate</th><th>Low</th></tr> <?relevance trs of (td of name of it & td of (number of relevant fixlets whose (source severity of it as lowercase = 
"critical") of it as string) & td of (number of relevant fixlets whose (source severity of it as lowercase = 
"important") of it as string) & td of (number of relevant fixlets whose (source severity of it as lowercase = 
"moderate") of it as string) & td of (number of relevant fixlets whose (source severity of it as lowercase = 
"low") of it as string)) of bes computers ?> </tbody> </table>

rharmer

This is very nice. Something that should be added to the base product or as an addon.

Yes, this has proven very popular. We will likely publish this one officially.

craigsmallman

When I used our “group computer” filter, it didn’t make any difference to the report.

I didn’t have any problems applying filters to this report. I tried a computer group filter and a retrieved properties filter. When you tried did the report show that a filter was applied above the column headings?

(imported comment written by Bjowah91)

jessewk,

Thank you for taking your time,.

Works brilliant now.

/Björn

(imported comment written by SystemAdmin)

jessewk

I didn’t have any problems applying filters to this report. I tried a computer group filter and a retrieved properties filter. When you tried did the report show that a filter was applied above the column headings?

Thanks again for the great code and your time. This is indeed perfect for our needs. When I ran the filter again, I noticed that all of my filters had been lost. I have no idea why this happened, but it does mean I have to recreate them all. The only thing I did was upgrade everything to the latest version but I dont see why that would effect it. Anyway, that would be the reason why the grouping didn’t work. I’ll redo the filters and try again.

Thanks once more for the great (and quick!) help

Craig

(imported comment written by rharmer91)

Is there a way to have this sort before it’s emailed?

Thanks,

Rich

(imported comment written by jessewk)

rharmer

Is there a way to have this sort before it’s emailed?

Yes. 3 easy steps:

  1. Edit sorttable.js to remove or comment out this line (at the very top):

addEvent(window, “load”, sortables_init);

  1. Give the column header you like to sort by a unique id:
Computer Name
  1. Add these lines to the bottom of the script, where ‘computername’ is the id you assigned the column header in step 2:

Note: This will increase the time it takes to load the page as it will have to perform an initial sort.

(imported comment written by SystemAdmin)

Any way to expand this report to make each computer expandable so that you could list out which fixes where required?

(imported comment written by jessewk)

jspanitz

Any way to expand this report to make each computer expandable so that you could list out which fixes where required?

Yes. If you change the line that starts: <?relevance trs of (td of name of it …

So that it says: <?relevance trs of (td of link of it …

That will make the names of the computers into links. Simply click on the computer name and it will take you the computer report for that machine. On the computer report will be a section with the relevant fixlets.

-Jesse

(imported comment written by gjahn23)

Hi guys - I’m relatively new at this coding.

I have a manager looking for a report called “Compliance of approved patches”

I am thinking that this would be a similar report to the one you’ve been working with here, but I’d need to apply a computer group(s) and multiple baselines to the report.

Anyone willing to help me out on this??

Gordy

(imported comment written by rdamours91)

Awesome…it would be great to see this one added to the canned reports. Great works guys…

I’d also like to be able to sort and filter on the location by ip groups I have done. This way I can get that exact info by location…as I have 200 + subnets.