Inspector question? using: default image of <grub config file>

Just started trying to learn some BigFix authoring, and I’m trying to figure out the proper syntax for this. I want to pass an integer value returned from one object property as the integer argument of a second object property. The specific object properties in question, under the “grub config file” object:

default image of <grub config file>

bootable image <integer> of <grub config file>

I want to use the result of the “default image of grub config file” as the integer argument for “bootable image (integer) of grub config file” (e.g. if “default image of grub config file” returns “2”, then I want to get the result of “bootable image 2 of grub config file”). I haven’t quite been able to work out the proper syntax, though.

Thanks,

Denny K

(this was wrong, but was fixed, see edit history)

bootable image (index of default image of ( grub config file ) ) of ( grub config file )

https://support.bigfix.com/inspectors/System%20Objects_Any.html#grub%20config%20file

That was the first thing I tried (with various permutations of parentheses), but it doesn’t seem to work in qna:

Q: bootable image (default image of ( grub config file ) ) of ( grub config file )
E: The operator "bootable image" is not defined.

The ‘default image of’ query works correctly by itself in qna, however, and the ‘bootable image’ query works when providing an integer value as the argument:

Q: default image of ( grub config file )
A: 0
T: 237

Q: bootable image (0) of (grub config file)
A: Red Hat Enterprise Linux Server (2.6.32-504.23.4.el6.x86_64)
T: 151

Is this just an oddity of the qna parser (and hence it would work in an actual fixlet/analysis/etc.)? Or am I missing something else?

Try:

bootable image (index of default image of ( grub config file ) ) of ( grub config file )
1 Like

Aah, that’s got it. Didn’t drill far enough down the object tree, I guess. Thanks!

1 Like

the issue was that bootable image accepts an integer, while default image returns a grub image choice, which can return the related integer value using index of it.

Obviously I made the same mistake until I looked closer at the documentation: https://support.bigfix.com/inspectors/System%20Objects_Any.html#grub%20config%20file

1 Like