Reporting of Specific Fixlets

Hey All,

I am looking to get feedback, on the best way to get the name of the flixlet, relevant computers, ect of a specific group of fixlets by ID.

Is this the best way to achieve it? Whats your opinion, or a possibly better way?

I was considering adding fixlets to a baseline, then using a set of fixlets inside the baseline… but couldnt get it to work.

( names of it , Operating System of it, (source ids of it as string, names of it) of relevant fixlets
whose (
( id of site of it = 2 or id of site of it = 5095 )
	AND
	(
		(ID of it > 405344000 and ID of it < 405344022) OR
		ID of it = 317464409 or ID of it = 317464401 OR
		ID of it = 286872515
	AND
		Applicable Computer Count of it > 0 
	)
) of it ) of elements of 
(
	set of members of bes computer groups 
	whose ( id of it = 2976 )
)

Well, you’ve entered one of the great debates and challenges, “the best way to do something”.

First off, does this give the result you want, and how long does it take?

At first glance, it looks like you’re doing it correctly - you start with the computers you’re interested in, you loop through the relevant fixlets for each, filtering the relevant fixlet list to only the ones you want. I think that’s a good approach to take.

A couple of minor things I’d change, is that you start with your computer group, retrieve the members, put them in a set, and then immediately iterate through the set. I think you could simplify

elements of ( set of members of bes computer groups whose ( id of it = 2976 ))

down to

`members of bes computer groups whose ( id of it = 2976 )`

In the ‘relevant fixlets’ filter, you have this comparison you’re making -

AND Applicable Computer Count of it > 0
…you don’t really need to check that; you know the Applicable Computer Count is greater than zero, because you created this fixlet object with the ‘relevant fixlet of <computer>’ inspector, so there’s at least one computer relevant or you wouldn’t be looking at this fixlet to start with.

In the end, where you’re selecting your properties, you’re using plurals
( names of it , Operating System of it, (source ids of it as string, names of it)
In many cases, plurals are a good thing in relevance to avoid errors; but here, it means that if any of these fields is undefined or not reported, that result would be silently discarded. It’s unusual, but in large deployments it’s common for a computer to not have reported its name, or for a fixlet to be missing a source id; in those cases the result would just disappear. I prefer to use a singular property, and the pipe operator ‘|’ to catch any errors and display a message for those. So I’d change this to

( 
  name of it | "<no computer name>" , 
  Operating System of it | "<no OS name>", 
  (source id of it as string | "<no source id>", 
  name of it | "<no fixlet name>"
)

In the end that all changes to

 (
      name of it | "<no computer name>" , 
      Operating System of it | "<no OS name>", 
      (source id of it as string | "<no source id>", 
      name of it | "<no fixlet name>"
      ) of relevant fixlets
whose (
      (id of site of it = 2 or id of site of it = 5095 )
	AND
	(
		(ID of it > 405344000 and ID of it < 405344022) OR
		ID of it = 317464409 or ID of it = 317464401 OR
		ID of it = 286872515
	)
)of it)
of  members of bes computer groups 
	whose ( id of it = 2976)

I’m at home now, so my entire deployment consists of 2 clients; I can’t scale that up to see the performance change, but my version trims a little bit off the evaluation time (11.062 ms versus the original query at 11.733 ms)

2 Likes

This is brilliant feedback, and much appreciated. Thank you.