Deploy license file to endpoint that meets criteria

I am attempting to create a fixlet to deploy a license file if the system has the service running. In this case it is an AD Bridge application. I tested some outputs on the endpoint with the qna tool.

Q: exists package “adb-agent” of rpm
A: True
T: 1479

Q: exists file "/opt/adb-agent/ADB-licfile.xml"
A: False
T: 78

This is my relevance for the fixlet:
(version of client >= “6.0.0.0”) AND ((exists true whose (if true then (exists (operating system) whose (it as string as lowercase = “Linux Oracle Enterprise Server 7” as lowercase)) else false)) AND (exists true whose (if true then (exists package “adb-agent” of rpm) else false)) AND (not (exists true whose (if true then (exists file “/opt/adb-agent/ADB-licfile.xml”) else false))))

Basically, if the agent is installed and there is no license file, the xml file, I want to deploy the ADB-licfile.xml. I have this on one system but it is not showing relevant in BigFix. I am still a beginner with relevance so go easy on me. :slight_smile:

Your relevance looks good to me. Nice use of guarded relevance.
I wonder if your OS check is coming up true?

q: (exists true whose (if true then (exists (operating system) whose (it as string as lowercase ="Linux Oracle Enterprise Server 7" as lowercase)) else false))

Please use the CODE tag when pasting code, so the formatting does not get funky with "smart quotes"
It looks like </> in the button bar.

Also, get the ID (####) of your Fixlet from the console, and then check the __BESData subfolders on the endpoint you think should be relevant for Fixlet####.fxf

If the agent does not have the Fixlet, it will not become relevant.

I removed the OS equals Linux Oracle Enterprise Server 7 and my hosts that this should be relevant appeared in the console.
cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="7.7"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.7"
PRETTY_NAME="Oracle Linux Server 7.7"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:7:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL=“https://bugzilla.oracle.com/

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.7
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.7

Q: (exists true whose (if true then (exists (operating system) whose (it as string as lowercase ="Linux Oracle Enterprise Server 7" as lowercase)) else false))
A: False
T: 218

Q: operating system
A: Linux Oracle Enterprise Server 7.7 (3.10.0-1062.12.1.0.1.el7.x86_64)
T: 99

I tried removing the 7 but using this my hosts disappear as being relevant.
(version of client >= "6.0.0.0") AND ((exists true whose (if true then (exists package "adb-agent" of rpm) else false)) AND (not (exists true whose (if true then (exists file "/opt/adb-agent/ADB-licfile.xml") else false))) AND (exists true whose (if true then (exists (operating system) whose (it as string as lowercase = "Linux Oracle Enterprise Server" as lowercase)) else false)))

Ok, thanks, that’s something we can work with.

First of all, consider the comparison you are trying to make. The operating system
"Linux Oracle Enterprise Server 7.7 (3.10.0-1062.12.1.0.1.el7.x86_64)" is not equal to "Linux Oracle Enterprise Server". I hope that’s clear, they just…aren’t the same value.

Instead of checking equality you’d need something like
(exists true whose (if true then (exists (operating system) whose (it as string as lowercase starts with "Linux Oracle Enterprise Server" as lowercase))

1 Like

Yes that does make sense. I was using the drop down options within the Relevance tab so used contains and that also appears to work.

Is there a way to test out the relevance from the BES Console or do you need to run the qna from the host itself? I thought I remember seeing or hearing about a way to run the qna remotely against Linux and Windows hosts which would speed up the trials and errors I am doing to create the relevance for my fixlets.

Thanks for all the assistance on this one!

Sure, remote debugging is, in my opinion, one of the best new features of the last several years.

You can use the Query app in WebUI, or in the Fixlet Debugger choose one of the top menu options Evaluate -> Evaluate Using -> Query Channel. That will ask for credentials to the BigFix Server, and a computer name or ID to query remotely.