Relavance help, Filter 'relevant fixlets'

(imported topic written by SystemAdmin)

I’m trying to create a custom report that we can send out via email. It’s an analyst type report so it would just list computer system along with identifying properties like ip, mac, custom prop1 etc along with fixlets belonging to a specific baseline.

example output

pc name1, pc ip1, pc mac1, pc custprop1, fixlet1, fixlet prop1

pc name1, pc ip1, pc mac1, pc custprop1, fixlet2, fixlet prop2

pc name2, pc ip2, pc mac2, pc custprop2, fixlet1, fixlet prop1

I have tried this relevance:

=======================================================================

trs of

(

td of (if exists name of item 1 of it then name of item 1 of it else “no name”) of it &

td of value of result (bes property “Mac Address”, item 1 of it) &

td of value of result (bes property “Location By IP Range”, item 1 of it) &

td of (if exists name of item 0 of it then name of item 0 of it else “no name”) of it &

td of (if exists source of item 0 of it then source of item 0 of it else “no source”) of it &

td of (if exists source id of item 0 of it then source id of item 0 of it else “no source id”) of it &

td of value of result (bes property “cust prop1”, item 1 of it) &

td of (if exists source release date of item 0 of it then source release date of item 0 of it as string else “no source release date”) of it &

td of (if exists category of item 0 of it then category of item 0 of it else “no category”) of it

)

of

(

relevant fixlets whose (name of it does not contain “some filter”)

of components of component groups

of bes fixlets

whose

(

baseline flag of it = true and

name of it contains “Cust Baseline 1”

), it

)

of bes computers whose

(exists result (bes property “computer name”, it) whose (value of it as string as lowercase starts with “PC name filter” as lowercase))

===============================================================

I have seen code in different posts where you use:

source fixlets

================================

=whose (

= name of it does not contain “Project”

= )

= of components of component groups of bes fixlets

= whose

= (

= baseline flag of it = true

= and name of it contains “December 2009”

= )

=====================================

http://forum.bigfix.com/viewtopic.php?id=4307&p=1

Is there a (reason / way) you (can / can’t) use this code:

======================================

=

= of components of component groups of bes fixlets

= whose

= (

= baseline flag of it = true

= and name of it contains “December 2009”

= )

======================================

with ‘source fixlets’ but not ‘relevant fixlets’?

Is there another way of doing this? I’d like to keep a way of filtering fixlet or system ‘names’ or other properties in the relevance if possible.

???

(imported comment written by SystemAdmin)

Well, no response so far. I’ll start from simpler expression…

The relevance:

names of source fixlets of components of component groups of

bes fixlets whose (baseline flag of it = true and name of it as lowercase starts with “baseline” as lowercase)

This code evaluates without error but returns no rows. Shouldn’t it return names of fixlets who belong to a baseline who name starts with ‘baseline’?

(imported comment written by SystemAdmin)

Your initial request is a bit muddled in that you’re trying to source different ‘sets’ of data together. How would you present computer details in a list along with fixlets? You do give an example of the computer data, but then just just generalise about wanting to include the fixlet information as well.

Have a try at searching in the forum and if you try the patch report files that have been posted, you might find something that does what you want (or at least is fairly close).

In regards to your second post, I don’t know whether you don’t have machines that are relevant for your baseline or if you have a baseline that actually starts with ‘baseline’. It works fine for me.

-Jim

(imported comment written by SystemAdmin)

Do you need applicable machines for a baseline for the 2nd post relevance to work? I expected it to return a list of fixlet names in a baseline defined by the whose clause regardless of whether applicable systems existed.

As for the relevance in the first post, I’m trying to generate a list of systems and which fixlets they need applied grouped by system. The fixlets being defined in a baseline. The bes console shows 5 machines under the applicable tab.

I’m glad the 2nd post relevance worked for you :slight_smile: It doesn’t seem to ‘work’ for me but it evaluates fine. The name of the baseline I’m trying to work with is ‘IMadeThisBaseline’.

I have altered the whose clause in the 2nd post relevance to just ‘baseline flag of it=true’ and it returns rows from baselines. When I add the ‘name of it=’ or ‘name of it starts with’ part, it returns no rows.

so

names of source fixlets of components of component groups of

bes fixlets whose (baseline flag of it = true)

returns rows of fixlets I’m assuming are parts of baselines ie ‘baseline flag of it = true’

This doesn’t return any rows:

names of source fixlets of components of component groups of

bes fixlets whose (baseline flag of it = true and name of it as lowercase starts with “IMadeThisBaseline” as lowercase)

Unless I’m not defining the name of the baseline in the right place, I’m not sure why it works for you but not me.

I don’t know if this makes a difference but I created the baseline so that all the components have no action in them. I’m testing so I didn’t want to actually carry out any action with the baseline, just test. This way the systems will always have the baseline as applicable.

Thanks for your help.

(imported comment written by SystemAdmin)

“You keep using that word. I do not think it means what you think it means.” -Princess Bride

(And maybe that applies to a few of the words, rather than just one.)

Roughly:

  • Actions are created to run fixlets, tasks or baselines on a specific set of machines (or named group).
  • Baselines (specialised fixlet that is a container) are collections of one or more fixlets and/or tasks, organised in component groups.
  • Fixlets and tasks are scripts that will be run (in the actions).

If you don’t have anything in a baseline, then your relevance will not return anything (which is exactly what it is doing).

The “names of source fixlets of components of component groups of …” code essentially takes any fixlets that are really baselines, looks in each component group of the baseline(s) to see what fixlets/tasks are in them and then produces the list of names for each.

That is pretty much just what the code is saying, but you have to get your head around how the relevance reads (backwards).

-Jim

(imported comment written by SystemAdmin)

I got the relevance to work. Thanks for the help.