We have a SIMPLE setup of Automatic Groups to separate our 2000+ servers.
Relevance Expression - is true - exists file “c:\govern\servergroup.txt” whose (exists (line of it) whose (it contains “group1”))
We currently use a server imaging system that builds new servers and as a last step of deployment creates a text file in the C:\Govern\ directory and populates the file with a simple string (eg. group1). Pretty simple, right?
Here’s the rub…BigFix will not add the new server to the group. It is as if the file/data is not there and the relevance expression is not detected.
HOWEVER: if I delete the file and make one manually it works just fine. We have verified that changing/recreating the data inside the file does nothing. Still no good. The file must be created anew. I have verified that it doesn’t matter how I create it (powershell, explorer, CLI, even using BigFix). It works just fine when I create it.
What we can’t figure out is why it ignores the text file that is laid down by the imaging product [major industry product] when all it is doing is issuing the same DOS command to create the file that I am when re-creating it.
Here is what we and the other methods are all using:
echo group1 > c:\govern\servergroup.txt
That’s it…that’s all. I have verified also that the permissions are identical on files created by any of the aforementioned methods.
PLEASE HELP! I suspect it’s an issue with the Relevance Engine, but IBM is not helping me with that theory.
I wasn’t sure from your comment if there is a relevance problem or something else so assuming its a relevance problem then have you tried doing simple things like checking what the
lines of file "c:\govern\severgroup.txt"
returns?
Also check that the following returns correctly
exists file "c:\govern\severgroup.txt"
You can do this as analyses or you can use QnA locally on the machine to do it but it sounds like something simple is missing.
What version of the platform are you using as well? If the text is ASCII like you are showing then its unlikely that there is any issue there
If its not a relevance problem can you post the complete relevance body of the group fixlet. There were some fixes in some builds if multiple elements are present but those were a while ago so again it helps to know what version of the platform you are using.
Your syntax appears to be better either way. I have made the change to several groups…nothing yet.
It is strange though as I have been using my syntax for quite some time with flawless results. And still doesn’t explain why deleting the text file and building a new one (in any fashion) without touching BF fixes the issue.
Reading this thread, I began to wonder if the issue might be that the line wasn’t terminated.
On my computer, I created a new folder “C:\govern” and issued the same command you did …
C:\>mkdir govern
C:\>echo group1 > c:\govern\servergroup.txt
C:\>type c:\govern\servergroup.txt
group1
C:\>
I then did the following in the FixletDebugger …
Q: exists file "C:\govern\servergroup.txt"
A: True
T: 0.163 ms
Q: lines of file "C:\govern\servergroup.txt"
A: group1
T: 0.262 ms
Q: exists line whose (it = "group1") of file "C:\govern\servergroup.txt"
A: False
T: 0.289 ms
Q: exists line whose (it contains "group1") of file "C:\govern\servergroup.txt"
A: True
T: 0.291 ms
Even though, the file contains the string “group1”, it seems like Relevance doesn’t see it as a “LINE” in and of itself, I’m betting because it doesn’t find a CR or LF at the end of the “line”.
I had mentioned in the original post that even when manually changed (including delete text from file/save/manually input text) doesn’t fix it. We have to delete the whole file.
Also, I have been using the “non-trimmed” version of my original script via powershell or CLI remotely on these server with no issue.
So maybe it’s not the file content, but a problem with the file itself? Something like an ACL blocking Read access for the SYSTEM account? Try using cacls to show the file permissions of the file your deployment tool generates, vs the one you create manually.
Otherwise, use something like notepad++ (in “show all symbols” mode) or kdiff3 to compare the file contents.
Jason, I was thinking something along these lines as well. We have verified it’s not an ACL as the file permissions are identical. But I will try the notepad++ idea to see if there are any weird symbols.