BigFix Relevance for Centos

Hello,

I am writing a relevance which should be applicable to CENTOS whose version 7.0, 7.1, 7.2, 7.3, 7.4, 7.5 ,7.6 , 7.7, 7.8 and 7.9

(((name of it as string as lowercase contains “centos” and (version of it >= “7” OR major version of it = “7.9”) and ((exists match (regex “x86_64”) of it) of architecture of it)) of operating system))

But it is not working, Kindly help

It’s always best to divide your relevance statement into several smaller statements if you notice any problems with it so that you can address the issue.

Here is what I did -

//your original query results:

Q: (((name of it as string as lowercase contains "centos" and (version of it >= "7" OR major version of it = "7.9") and ((exists match (regex "x86_64") of it) of architecture of it)) of operating system))
E: The operator "equal" is not defined.

//statement 1:

Q: ((name of it as string as lowercase contains "centos") OF operating system)
A: True
T: 297

//statement 2:

Q: (name of it as string as lowercase contains "centos" AND version of it >= "7") of operating system
A: True
T: 57

//statement 3: problem found with major version

Q: ((name of it as string as lowercase contains "centos" AND version of it >= "7" AND major version of it = "7.9")) of operating system          
    E: The operator "equal" is not defined.

//lets test it separately

Q: major version of operating system 
A: 8
T: 100

//Improved statement 4:

Q: ((name of it as string as lowercase contains "centos" AND version of it >= "7" AND major version of it = 7) OF operating system)
A: False
T: 77

//working one

Q: (((name of it as string as lowercase contains "centos" and (version of it >= "7" OR major version of it = 8) and ((exists match (regex "x86_64") of it) of architecture of it)) of operating system))
A: True
T: 265

//if you really want to limit it equal to 7.9, you can try something:

Q: ((name of it as string as lowercase contains "centos" AND version of it >= "7" AND version of it <= "7.9") of operating system) 
A: False
T: 86

Problem which we found is major version relevance returns only the major version number of the operating system. It does not include minor or patch version information.

1 Like

Thanks, but in that case if the CENTOS OS version is 6 or 6.1 then still this relevance show you True value.

What I wanted to achieve is my relevance should come True only when it found CENTOS version 7.0, 7.1, 7.2, 7.3, 7.4, 7.5 ,7.6 , 7.7, 7.8 and 7.9, anything else should be False

Pls see this

Q: ((name of it as string as lowercase contains “centos” AND version of it >= “6.1” AND version of it <= “7.9”) of operating system)
A: True
T: 362

You can try this if you’d like to do it explicitly:

Q: ((name of it as string as lowercase contains "centos" AND version of it as string starts with "7" AND version of it <= "7.9") of operating system)

which of @vk.khurava’s queries above is giving you a false-positive on CentOS 6 or 6.1? The queries in his post are meant to demonstrate the pieces of the query, which you then AND together to get a single statement.

Because a ‘version’ comparison terminates at which version string is “shorter”, version "7" = version "7.1.2.3" will return True. Hence you can combine the version checks into

(it="7" and it <= "7.9") of version of operating system

There’s also no need to use a regex to compare the ‘architecture of operating system’. This is provided by our inspector, and the possible values are a very small number of literal strings, so we can just use the equals operator.

Combining it all together we should be able to test

(name of it contains "CentOS" and (it = "7" and it <= "7.9") of version of it and architecture of it = "x86_64") of operating system
3 Likes