References to relevance

(imported topic written by SystemAdmin)

I know there have been posts here in regards to using a reference to a pre-existing relevance in another fixlet and that you’ve had a ‘heated debate’ internally around the subject as well and that as a result you came to the understanding that references are ‘bad’ and that you can’t easily make them work in your current infrastructure.

The concern I have about not using references goes back to the very painful (and sometimes dangerous) notion of copy and pasting identical code chunks around in scripts. This is a known issue where you will subsequently change an element of the code someplace (finding a bug in what you thought was rock-solid code, or perhaps having to deal with new circumstances) and in many cases, want to (or even need to) go back to every instance where that was used and make the same change.

In my situation, I am visualising the need to use a number of somewhat convoluted expressions (and sometimes negated) in multiple Fixlets and possibly an analyses or two. How can I safely manage this code?

Now, I understand the issue of you not wanting to have one Fixlet’s relevance used in a second, as when you change the first, you would then have to decide how or if to change the second (and do they have the rights, etc.). However, you currently do exactly that for Baselines. You are essentially storing a reference to a Fixlet within a Baseline and actually even check for modifcations withing the Baseline for when any of the original Fixlets are modified. How is this very different from using a reference to a relevance from another Fixlet?

I would like to see the ability to store relevances on their own in the database and have the console keep track of the use of the relevances (similar to Baselines). This would then allow me to write things like:

{Tracked_relevance “Extract version number for Symantec AV” > “11.00.0” as version}

and use the same reference for multiple tests. The inspector “Tracked_Relevance” would merely make use of the stored ‘master’ relevance and for your purposes, internally, you would just replace the code when you package the Fixlet. An additiona (and important) consideration would be to add a HUGE amount of clarity to the relevances. I don’t know how many times my eyes and mind have wandered when trolling through a lengthy relevance including"…first 3 of preceding text ‘:’ of last 26 of…" or “…key “HKLM\xxxxx\yyyyy\zzzzz” of registry…” where I would much rather see the simple line as shown in my example, above.

If the ‘master’ relevance changes (possibly fixing an incorrect element) in the source database, I would then have the option to create a new master based on the ‘old’ settings (and point any affected Fixlets to it) or modify the fixlets to re-synch with the (now correct?) master relevance. Job done.

Discuss.

(imported comment written by BenKus)

Hey jwilkinson,

For your point about Baselines, actually we do NOT store references to Fixlets in a Baseline. We make a copy of them (for exactly the reasons you describe around consistency).

We definitely understand your arguments and there are two major issues to deal with:

  1. The “right” answer is not clear because both sides have big advantages/disadvantages. Currently we have decided on the answer that errs on the side of consistency, security, and clarity (meaning there should be very little mystery of what you are changing when you edit relevance/property/Fixlet/etc), but unfortunately it has the downside you are mentioning which is requiring more effort to make changes to relevance you have in lots of places.

  2. For better or worse, we have made this decision a long time ago and it is now built into the product. If we change it now, we will doubtless hear from all the people who have become accustomed to the current behavior and the change might cause significant problems. Not to mention it would be a serious development undertaking.

Here is something that might help… If you have big blocks of relevance that you commonly use, you might consider making them a “dynamic setting” (more info here: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=281). The idea here is that the agent will periodically evaluate the relevance and store the result in a client setting. Then you can refer to the client setting instead of referring to the big relevance expression.

For example… imagine you had a big block of relevance to determine the Symantec version. You could use the instructions in the KB article I sent to make a dynamic setting for the symantec version.

Then once you had that, you could use the relevance in any property or Fixlet:

value of setting “SymantecVersion” of client

We use a technique very similar to this in our “Location By Subnet” Wizard because the relevance is too big to be copied many times.

WARNING: You should probably avoid over-using this technique. I probably wouldn’t use it unless the relevance expression is very common or very large because it introduces some agent overhead and you should also note that it will take a little bit of time for the agent to notice the relevance has changed and update the setting value.

Having said all of that, there might be an interesting development solution we could potentially think of and I filed an enhancement request as #26319.

Ben

(imported comment written by SystemAdmin)

Ben, thank you for your reply. It was pretty much as I expected, but I guess I was hoping you’d have some thoughts along the lines of ‘best practices’ for how you manage situations like this or alternatives. And interestingly enough, you certainly did the latter.

In this situation, the tests would be valid for all the machines in the environment, so using dynamic settings might be viable solution. One of the downsides is that we may need a more timely response (doesn’t change often, but we’d like to know asap), so unless we know what the time interval for checking the DSs (or can check and change that interval without overloading the clients) this may not be workable. Secondly, if we did reduce the interval for checking the DS expressions, would this have a noticeable impact on the client? Reduce it just enough to get a sweet spot between checks and low client interference?

But if this isn’t workable, we’re back to doing what we were before, which is to have collections of fixlets that check criteria and either set or unset registy keys (which then trigger other activities) and the issue of trying to keep related relevances in sync. Which I think is quite likely.

Lastly, I guess that you don’t want to get my (our?) hopes up in regards to any potential product enhancements, but any possibility you might leak some info of what is in ER #26319? :slight_smile:

(imported comment written by BenKus)

Hey jwilkinson,

Here is what I filed for bug #26319:

Summary: ‘Add a way to refer to “Relevance Macros” in BES’

Description: ‘See http://forum.bigfix.com/viewtopic.php?id=3237

The reason it is phrased this way is that our internal Fixlet development software has the capability of doing something similar and so my request is to extend this concept to BES.

It is currently marked "Reconsider after next release’, which means that we can’t fit it into this next release, but we might be able to get it in after that.

Ben

(imported comment written by SystemAdmin)

Ben,

I would like to mention, as many others have done, that the support for your product and the feedback on these forums is excellent. I may not always be completely happy with a response to a query, but at least I can be fairly sure it will be thought about (rather than just a canned response) and probably quite fast.

Thanks for the information. It would be nice to think that something like this might be implemented, even if not currently, as I can envision the need to do more and more ‘redundant’ coding as our use of Bigfix grows and would want to try to manage those redundant elements.

Speaking of which, I am now in the process of working on an enhancement of the dashboard tool and you might have seen my post where I’m asking about a couple of issues (features?) I’ve noticed with it. There has already been work done for the technical page and in there are yet another set of reused relevances. Those references would be very handy, methinks. :slight_smile:

(imported comment written by BenKus)

Thanks, jwilkinson… We try hard to make sure that our system is powerful and flexible but to take advantage of the advanced features, you often have many questions so we our best to answer questions and try to keep an active community.

Ben