Trouble evaluating relevance for group memberhsip

(imported topic written by murtasma91)

We use a text file as one of the properties to help determine operator account delegation in our envrioment. I have many departments using this text file for delegation with out issue. I have run into a workstation that is not evaluating true when I believe it should be. The file lives in the directory where the BigFix client resides. Inside the text file it’s formated as such

admin=SERIAL-NUMBER

(version of client >= “6.0.0.0”) and (true and exists true whose (if true then ((if (exists file “Admins.txt” of parent folder of client) then following texts of firsts “=” of (it as string) of lines whose (it as string starts with “admin=”) of file “Admins.txt” of parent folder of client else “no file”) as string as lowercase = “F5820” as lowercase) else false))

Here is the code that keeps returning false. I’ve verified that the client is greater then 6.0.0.0 and the text file is placed in the correct loaction with the correct serial number. I’ve looked at other computer groups and the code is pretty much the same excluding the diffrence in serial numbers.

Using the relevance debugger on the machine returns false when I evaluate the code. I tried to use the graphical break down feature to see where the issue may be and it looks like the BigFix client is having trouble finding the file (unless there is some kind of syntax error with the relevance). I’ve verified that the system account has acess to this file.

Update: Just tried this one another machine and it also evaulates as false. Looks like there maybe something wrong with the generated relevance.

(imported comment written by Lee Wei)

Murtasma,

The results from the Relevance Debugger is probably different than the actual client.

parent folder of client should be:

C:\Program Files\BigFix Enterprise\BES Client

The “parent folder of client” for the Relevance Debugger is different, so you might be picking up a different admin.txt file.

Substitute that statement with the actual pathname to test your statement.

It will also help if you show us the actual content of the admin.txt file just to make sure.

Lee Wei

(imported comment written by murtasma91)

Here is the updated relevance I just tested with the full pathname specified.

(version of client >= “6.0.0.0”) and (true and exists true whose (if true then ((if (exists file “C:\Program Files\BigFix Enterprise\BES Client\Admins.txt”) then following texts of firsts “=” of (it as string) of lines whose (it as string starts with “admin=”) of file “C:\Program Files\BigFix Enterprise\BES Client\Admins.txt” else “no file”) as string as lowercase = “F5820” as lowercase) else false))

The results still returned false.

The content of the Admins.txt is

admin=F5820

(imported comment written by Lee Wei)

Oh, I miss it the first time around:

If we convert the values into lowercase, then the string on the right should be “f5820”.

…as string as lowercase = “f5820”…

Lee Wei

(imported comment written by murtasma91)

Just made the change in the relevance to

as string as lowercase = “f5820”

I then tried to evaluate the expression again with both a captial F and a lowercase F in the file name but the debugger returned returns false.

(imported comment written by Lee Wei)

You can try this statement:

if 
    (exists file "Admins.txt" of parent folder of client) 
then 
    (it as lowercase = "f5820") 
    of following texts of firsts "=" 
    of lines whose (it as string starts with "admin=") 
    of file "Admins.txt" of parent folder of client 
else 
    false

(imported comment written by murtasma91)

The code you sent worked when I specfied the full path to the file in the debugger and didn’t use the of parent folder of client.

Since I am unable to directly edit the relevance of group memberships I had to export the group and modify the releveance in the generated BES file. Once I imported the modified gorup and refreshed the client it still seems to think it’s not relevant. I verified that the group fxf file is the site container on the client under C:\Program Files\BigFix Enterprise\BES Client__BESData\CustomSite_CPPM_Master_Operators

I then decided to use the full path of the file instead but still have the same problems. Do you have any other ideas of things I can try to do?