Linux server version keeps changing

Arkterix
Tera Contributor

Hi all,

Have an issue with Linux server os version (os_version) that keeps changing/fluctuating with every discovery. This started to appear after upgrading to Utah (patch2-hotfix4). Have not seen it before. And since we use distribution version, ie 7.9, as basis for patching this will not work.

 

Looking at the pattern it seems like ServiceNow is updating os version with both the kernel version, and then afterwards with the distribution version.

 

As a first step I disabled the ServiceNow step that adds in kernel version into this field. There is an additonal step stopping this to work (in some odd cases), step 9.5, why build a condition like that?

 

Your thoughts? Anyone else seen this changing os version? Any advice on solution?

 

Cheers, /Johan

9 REPLIES 9

Kavita Beazley
Tera Contributor

I am facing the same issue. Were you able to find a resolution?

I have found that it happens when the output from the cat /etc/*release | grep -v ID_LIKE | grep -v LOGO command within the Linux Distribution pattern is as follows;

LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

Red Hat Enterprise Linux Server release 6.10 (Santiago)

Red Hat Enterprise Linux Server release 6.10 (Santiago)

I see OS version is extracted in this Step using JS and later Set

 

RahulPriyadars_0-1704943229917.png

 

RahulPriyadars_1-1704943255671.png

Regards

RP

Thanks Rahul. Yes, that's where the cat command i pasted in my reply earlier comes from. However, our problem is that the value returned is not consistently get set to the version (e.g; 7.9) and therefore the updated os version keeps swapping between the kernel release value from the uname command and the above cat command to show below.

KavitaBeazley_0-1705085553906.png

 

Hi Kavita,

 

That is the same issue I had, looking at your CI history log.

 

The problem is that the ServiceNow pattern is using two "types" of version as input to that field, Distribution version and Kernel version. I was in contact with the servicenow support but they showed no intrest in resolving this.

 

Another part of the issue is that command (in the pattern) to get the Distribution version occasionaly and intermittently fails(1-2% of our Linux servers if I remember correct). When it fails the pattern will "default" to Kernel version. Which is the effect that you see.

 

There are two stages in the pattern affecting this field:

Kernel version, steps in the Linux server pattern:

1.1. Get system info
=> "uname -a"

1.4. Extract OS version from uname

2. Insert OS name, version and name to cmdb_ci_linux_server

The result of this os version is something like: 3.10.0-1160.102......

 

And Distribution version:

9.1. Get distribution

=> "cat /etc/*release | grep -v ID_LIKE | grep -v LOGO"

9.2. Extract distribution version

9.5. Update OS version on Linux CI

The result of this os version is something like: 7.9

 

From this you need to firstly decide which of these two versions are most important to you.

For me it was Distribution version for the reasons I mentioned above. Can return with more details if this is the intresting version.

 

Best regards, /Johan
(New mail/account, same person.)