(imported topic written by NoahSalzman)
Hey Forum,
Version 8.0 has a number of new Inspectors you can use when writing Relevance for Fixlets, Actions, etc. This is
not
a comprehensive list nor is it a replacement for an official user guide… just thought it might help some of the Relevance writers out there explore new 8.0 features and functions.
Also, don’t forgot about our online
Inspector search utility
,
Fixlet Debugger
, or this extremely handy trick:
properties whose (it as string contains “process”)
where “process” can be any string found in a Relevance Inspector (such as “time”, “task”, “interface”, etc.). It’s a great way to search for Inspectors when you are working in the Fixlet Debugger.
Contents
- Task Manager (Processes)
- Scheduled Tasks
- Wildcard search for files and folders
- Environment variables
- Substring index of string
- Range (integers in …)
- Tuple comparison
- Bar (OR) operator
- Sum of time
- Sum of floating point
- Version of operating system
- Last write time of registry key
- Regex escaping
color=greenTask Manager (Processes)[/color]
q: (working set size of it / 1024, page file usage of it / 1024, user of it) of processes whose (name of it is
"SQLAGENT.EXE") A: 6492, 9336, TESTBOX\Administrator
An example of how to bring back every property of running processes:
( name of it, (
if exists image file of it then pathname of image file of it
else
"n/a"), id of it, page fault count of it, peak working set size of it, working set size of it, quota peak paged pool usage of it, quota paged pool usage of it, quota peak nonpaged pool usage of it, quota nonpaged pool usage of it, page file usage of it, peak page file usage of it, io read count of it, io write count of it, io other count of it, io read size of it, io write size of it, io other size of it, creation time of it, kernel time of it, user time of it, gdi object count of it, user object count of it, handle count of it, session id of it, wow64 of it, user of it, (
if (base priority of it = normal priority) then
"Normal"
else
if (base priority of it = high priority) then
"High"
else
if (base priority of it = idle priority) then
"Idle"
else
if (base priority of it = realtime priority) then
"Realtime"
else
if (base priority of it = above normal priority) then
"Above Normal"
else
if (base priority of it = below normal priority) then
"Below Normal"
else
"N/A") ) of processes
color=greenScheduled Tasks[/color]
q: names of running tasks A: SystemSoundsService A: HotStart A: MsCtfMonitor q: (names of it, paths of it, next run times of it) of scheduled tasks A: AD RMS Rights Policy Template Management (Automated), \Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated), ( Thu, 19 Aug 2010 03:05:32 -0700 ) A: AitAgent, \Microsoft\Windows\Application Experience\AitAgent, ( Thu, 19 Aug 2010 02:30:00 -0700 ) A: ProgramDataUpdater, \Microsoft\Windows\Application Experience\ProgramDataUpdater, ( Thu, 19 Aug 2010 00:30:00 -0700 ) A: Consolidator, \Microsoft\Windows\Customer Experience Improvement Program\Consolidator, ( Wed, 18 Aug 2010 22:00:00 -0700 ) A: KernelCeipTask, \Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask, ( Thu, 19 Aug 2010 03:30:00 -0700 )
An example that shows how to list all of the tasks that will run at logon:
q: names of scheduled tasks whose (exists definitions whose (exists triggers whose (type of it is logon task trigger type) of it) of it) A: AD RMS Rights Policy Template Management (Automated) A: AD RMS Rights Policy Template Management (Manual) A: Microsoft-Windows-DiskDiagnosticResolver A: HotStart A: Logon Synchronization A: AutoWake
color=greenWildcard search for files and folders[/color]
q: names of find folders
"system*" of windows folder A: system A: system32 q: number of names of find folders
"*86*" of folder
"C:\windows\winsxs" A: 23 q: number of find folders
"win*" of find folders
"system*" of windows folder A: 3 q: number of names of find files
"*" of find folders
"X86*" of find folders
"win*" of windows folder A: 51 q: find files
"*" of folder
"c:\" A:
"AUTOEXEC.BAT"
""
""
""
"" A:
"boot.ini"
""
""
""
"" A:
"CONFIG.SYS"
""
""
""
"" A:
"IO.SYS"
""
""
""
"" A:
"MSDOS.SYS"
""
""
""
"" A:
"NTDETECT.COM"
""
""
""
"" A:
"ntldr"
""
""
""
"" A:
"pagefile.sys"
""
""
""
"" A:
"test.txt"
""
""
""
""
color=greenEnvironment variables[/color]
Q: value of variable
"PATH" of environment A: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin Q: (names of it, values of it) of variables of environment A: BESClientActionMastheadPath, /etc/opt/BESClient/actionsite.afxm A: BESClientConfigPath, /var/opt/BESClient/besclient.config A: CVS_RSH, ssh A: DISPLAY, :0 A: G_BROKEN_FILENAMES, 1 A: HISTSIZE, 1000 A: HOME, /root A: HOSTNAME, t-rhel5-x86-1 A: INPUTRC, /etc/inputrc A: KDEDIR, /usr A: KDE_IS_PRELINKED, 1 A: KDE_NO_IPV6, 1 A: LANG, en_US.UTF-8 A: LD_LIBRARY_PATH, /opt/BESClient/bin A: LESSOPEN, |/usr/bin/lesspipe.sh %25s A: LOGNAME, root Q: variables of environment of process 2186 A: BESClientActionMastheadPath = /etc/opt/BESClient/actionsite.afxm A: BESClientConfigPath = /var/opt/BESClient/besclient.config A: BESRelayConfigPath = A: CONSOLE = /dev/pts/0 A: DISPLAY = :0
color=greenSubstring index of string[/color]
q: substring(0, 3) of
"abcdefgh" A: abc q: substring(3, 3) of
"abcdefgh" A: def q: concatenation
"," of substrings (integers in (0, length of it, 2), 2) of
"00000b00010002000000000000000000" A: 00,00,0b,00,01,00,02,00,00,00,00,00,00,00,00,00
color=greenRange (integers in …)[/color]
q: integers to (3) A: 0 A: 1 A: 2 A: 3 q: integers in (-2, 2) A: -2 A: -1 A: 0 A: 1 A: 2 q: integers in (-10, 3, 3) A: -10 A: -7 A: -4 A: -1 A: 2 Q: integers in ((0, length of it, 2) of
"00000b000100") A: 0 A: 2 A: 4 A: 6 A: 8 A: 10 A: 12 q: concatenation
"," of substrings (integers in (0, length of it, 2), 2) of
"00000b00010002000000000000000000" A: 00,00,0b,00,01,00,02,00,00,00,00,00,00,00,00,00
Here is a real life example. One of our engineers needed to combine the list (1, 2, 3) with the list (a, b, c) to produce (1a, 2b, 3c). This is fairly complicated to do in Relevance but the new range operator made it a little easier:
Q: substrings (integers in (0, length of it, 2) , 2) of (concatenation of substrings ((item 0 of it ; item 0 of it + item 1 of it) of (positions of first ((length of it - 1) / 2) of it, length of it / 2), 1) of it) of concatenation of ((
"1";
"2";
"3"); (
"a";
"b";
"c")) A: 1a A: 2b A: 3c
The above code, another solution found by Jesse, also happens to be a great example of using the “item N of it” syntax for indexing into a list of objects.
color=greenTuple comparison[/color]
Q: (1, 2, 3) < (2, 3, 4) A: True Q: (
"a",
"b",
"c") < (
"a",
"b",
"d") A: True
color=greenBar (OR) operator[/color]
q: size of file
"c:\test2.txt" | 10 A: 10 q: (size of file
"c:\test.txt" > 0) |
false A: False q: ( (not exists file
"c:\test.txt") | (size of file
"c:\test.txt" = 0) ) A: False
This has some very nice implications for simplifying “if exists” statements. Here is the old way of doing things:
(
if ( exists result ( it,bes properties
"Shared Groups" ) whose ( exists value of it ) ) then value of result ( it,bes properties
"Shared Groups" )
else
"No Result" ) of bes computers
And here is the new way (thanks to Jesse for pointing this out):
( value of result ( it,bes property
"Shared Groups" ) |
"No Result" ) of bes computers
color=greenSum of time [/color]
q: sum of (second; minute; hour; day) A: 1 day, 01:01:01 q: sum of ((second * 5); (minute * 3)) A: 00:03:05 q: sum of ((second * 1); (second * 2); (minute * 3); (minute * 4); (hour * 5); (hour * 6); (day * 7); (day * 8)) A: 15 days, 11:07:03 q: sum of ((second * 5); (minute * 3); (hour * 17); (day * -23)) A: -22 days, 06:56:55 q: sum of (second / 10) A: 00:00:00.100 q: sum of ((hour + hour)) A: 02:00:00
color=greenSum of floating point[/color]
q: sum of (
"1.2" as floating point;
"1.5" as floating point) A: 2.7 q: sum of (more significance 1 of floating point
"1";
"1.1" as floating point) A: 2.1 q: sum of (
"1.1" as floating point;
"1.06" as floating point) A: 2.2 q: sum of (
"1.10" as floating point;
"1.06" as floating point) A: 2.16 q: sum of (more significance 1 of floating point
"1.1";
"1.06" as floating point) A: 2.16 q: product of (
"1" as floating point;
"2" as floating point;
"3" as floating point) A: 6
color=greenOperating system inspectors[/color]
Q: version of operating system A: 6.1.7600
A new shortcut to replace the
name of operating system as lowercase contains “win”
syntax. Acceptable values are windows, mac, and unix:
Q: windows of operating system A: True
color=greenLast write time of registry key[/color]
q: last write time of key
"HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\" of registry A: Thu, 07 Jan 2010 17:32:08 -0800
color=greenRegex escaping[/color]
q: regex escape of
".[]{}()\*+?|^$,-" A: \.\[\]\
{\
}\(\)\\\*\+\?\|\^\$\,\- q: exists matches( regex(regex escape of
".[]{}()\*+?|^$,-" )) of
".[]{}()\*+?|^$,-" A: True
+Edits to original post:
- Added scheduled task example showing logon tasks