Practical Guide to Relevance

Download Report

Transcript Practical Guide to Relevance

Practical Guide to Relevance
Ben Kus – 1/31/2008
IT Just Works
©2008 BigFix, Inc.
Presentation Goal
• Explain Relevance
• Help Relevance beginners get started
• Help round out knowledge for more advanced users
• Explain some tools and resources
• Teach some tips/tricks
• Caution against some potential pitfalls
July 15
IT Just Works
2
©2008 BigFix, Inc.
About Relevance
• Origins of Relevance
– Created in 1997
– We needed language that could describe computer issues
– No other good languages available
• Design Goals
– Query-only language – not allowed to change things
– Powerful – be able to express very complicated expressions
– Cross platform – language shouldn’t be OS dependent
– Extensible – add new “inspectors” over time
– Easy to read – should be readable by untrained users
– Reasonable learning curve – easy things easy, hard things not
too hard (make relevance author’s life as easy as possible)
July 15
IT Just Works
3
©2008 BigFix, Inc.
Compare Relevance to other Languages
• How does Relevance compare to other languages in
terms of the design goals (Ben’s opinion):
Language
Query
only
Powerful
Cross
Platform
Extensible
Easy to
read
Learning
Curve
VBScript
No
Yes
No
Yes
No
Medium
Jscript
No
Yes
Yes
Yes
No
Medium
WMI
Sorta
Not really No
Yes
Yes
Easy
PERL
No
Yes
Yes
Yes
No
Medium
C++
No
Yes
Yes
Yes
No
Hard
.INF
Yes
No
Yes
No
Yes
Easy
Relevance
Yes
Yes
Yes
Yes
Yes
Easy
July 15
IT Just Works
4
©2008 BigFix, Inc.
Relevance Attributes
• Relevance queries …
– will not change your computers
– will try to avoid causing network traffic (if at all possible)
– can be “English-like” for easier reading
– will generally try to find the most efficient way possible to get the
information
– will always try to be “safe” and “standard”
• BigFix spends a lot of time maintaining the Relevance
language and inspectors to meet all these goals as much
as possible
July 15
IT Just Works
5
©2008 BigFix, Inc.
Terminology
• Relevance – Language name
• Relevance Engine – Engine that processes relevance
• Inspectors – “objects” in the Relevance Language
•
•
•
•
(“operating system”, “rpm”, “ram”, “time”, etc.)
QnA (or “Fixlet Debugger”) – Tool to evaluate relevance
Actionscript – BigFix action language (not Relevance)
Fixlet – Relevance + Action + Description
Property – Relevance query the agent returns
July 15
IT Just Works
6
©2008 BigFix, Inc.
The Many Uses of Relevance
• BigFix uses Relevance for many reasons:
– Retrieve properties from agents
– Used in Fixlets / Tasks
– Used to define actions and constraints
– Customize ClientUI
– Used in Dashboards/Wizards (session relevance)
– Basis of Custom Reports (session relevance)
July 15
IT Just Works
7
©2008 BigFix, Inc.
BigFix Inspectors
•
•
Each Inspector is built by BigFix to make it easy for Relevance
authors to get information
There are many, many inspectors for all OSes
– file, folder, registry, rpm, wmi, processor, ram, pkgmgr, time, string,
metabase, running application, regapps, dacls, …
•
•
Each inspector is programmed by BigFix to get information through
whatever the best mechanism (mostly OS API calls)
The size of the full inspector guides give a sense of the amount of
inspectors:
–
Almost 400 pages for Windows
– 200+ pages each for Linux, Solaris, HPUX, AIX, Mac
• BigFix Goal:
– Continue to make more inspectors to make our customers have more
flexibility and ease of use
July 15
IT Just Works
8
©2008 BigFix, Inc.
Where to begin?
• BigFix provides Relevance training courses
– Company-specific classes available
– Regional classes available
• Many people learn Relevance on their own
• One key to learning Relevance is the Fixlet Debugger
– http://support.bigfix.com/fixlet/
• Try some basic queries
• Steal Relevance and modify it yourself!
– From BigFix Fixlets, Properties, Forum posts, etc.
July 15
IT Just Works
9
©2008 BigFix, Inc.
Some Major Forms of Relevance
1. <Property> of <Object>
–
–
Q: size of file "c:\boot.ini"
Basic form of relevance
2. if (condition) then ("T") else ("F")
–
–
Q: if (exists file "c:\boot.ini) then (size of file "c:\boot.ini) else (0)
Good for analysis or retrieved properties
3. <Property> whose (condition of it) of <Object>
–
–
Q: size whose (it > 10) of file "c:\boot.ini"
Filters a list
4. (it) of <Property> of <Object>
–
–
10
Q: (it) of size of file "c:\boot.ini"
Allows for singular treatment of items in a list
IT Just Works
10
©2008 BigFix, Inc.
Example Fixlet Scenario
• (Example taken directly from forum post)
• Problem: Computers need to have folder “C:\Logs”
• Need to create a custom Fixlet
– Relevance: check if folder exists
– Action: create folder
• Process:
– First, need to find Relevance / Actionscript (look at other Fixlets,
experiment, ask on forum, …)
– Verify with Fixlet Debugger
– Create custom Fixlet and test
July 15
IT Just Works
11
©2008 BigFix, Inc.
Example Fixlet Scenario – Couple notes…
• Because we were detecting a specific condition and we
needed to change something, we used a Fixlet (or Task)
• Fixlet relevance must evaluate to “True” or “False”
– errors are equal to “False” for Fixlets
• Action status is determined by the relevance for Fixlets
– Fixlets must start as “True” and after the action change to “False”
for the status to change to “Fixed”
• If the relevance is still “True”, it will be “Failed”
– Tasks will return “Completed” if the action ran all the lines
July 15
IT Just Works
12
©2008 BigFix, Inc.
Example Property Scenario
• Problem: Need to find the version of the WMI
• Tools
– Look through Fixlet relevance
– Use the “inspector search engine”
– Use the Fixlet Debugger
• Process:
– Need to find the relevance
– Refine the relevance using the Fixlet Debugger
– Create a custom property in BigFix
July 15
IT Just Works
13
©2008 BigFix, Inc.
Fixlet Debugger
• The Fixlet Debugger is the most useful tool for a
Relevance Author
• There are multiple modes for Fixlet Debugger:
– QnA Mode – Q:/A: format that is simple and easy
– Single Clause Mode – Helps read large Relevance queries
– Graphical Breakdown Mode – Graphical representation of the
Relevance query (very useful for debugging)
– Action mode – Test actions (new functionality in Alpha)
• Make sure your version number matches your agent
version number
• Pay attention to “Evaluation Times” to make sure no
queries run too long (2ms is short.. 1 sec is very long)
July 15
IT Just Works
14
©2008 BigFix, Inc.
Relevance Building Tools
• Fixlet Debugger
– http://support.bigfix.com/fixlet/
– Very useful for testing Relevance/Actionscript
• Inspector Search Engine
– http://support.bigfix.com/inspectorsearch/inspector_search.html
– Great way to search for Relevance Inspectors
– Much easier to use than the full PDF “Inspector Guides”
• BigFix Forum
– http://forum.bigfix.com
– Post your Relevance questions
July 15
IT Just Works
15
©2008 BigFix, Inc.
Relevance Building Tools (more…)
•
More Guides / Quick References
–
•
http://support.bigfix.com/fixlet/
Action Guide Examples
– Easy way to get acquainted with actionscript
•
Relevance Error Messages
– Help understand those confusing error messages
•
Custom Authoring Training Guide
– Good place to start if you don’t know any Relevance
•
Inspector Guides
– All inspectors listed for all supported OSes
•
http://support.bigfix.com/bes/misc/retrievedproperties.html
– Useful for looking at lots of bits and pieces of relevance
•
http://search.bigfix.com!
July 15
IT Just Works
16
©2008 BigFix, Inc.
What to worry about?
• Relevance is designed to be safe, but you can still cause
issues if you aren’t careful:
– Relevance that runs too long
•
Always check evaluation times
• Be careful with WMI
– Relevance that iterates over too many files
• Avoid causing too much disk IO
– Descendants of folder, lines of file, etc.
– Relevance that causes undesired side-effects
• Be careful with any query that might cause AD traffic
– Domain users, security permissions, etc.
July 15
IT Just Works
17
©2008 BigFix, Inc.
What to do when stuck?
• Find ways to get the information outside of BigFix
– Is there a file with the info?
– Is it in the registry?
– Will the WMI help?
– Is there an application to run to get the info?
• Once you know how to find the information, getting the
relevance right is usually the easier part
• The forum is your friend!
July 15
IT Just Works
18
©2008 BigFix, Inc.
Questions?
July 15
IT Just Works
©2008 BigFix, Inc.