How to populate RAM field in Gb as existing one is showing value in Mb but lable as Gb.

nick2015
Tera Contributor

Hi,

I am working on Helsinki version and discovered Windows and Unix devices. On server form RAM label is in Gb but value appears in Mb. Please help me how to convert Mb value into Gb value before populating the RAM field.

Regards,

Nick

1 ACCEPTED SOLUTION

Dave Smith1
ServiceNow Employee
ServiceNow Employee

Tried:


if (columns[0] == "MemTotal:")


ram += parseInt(columns[1]) / 1073741824;


...?


View solution in original post

7 REPLIES 7

Hi,



Thanks Dave.



I got the correct value for Windows server Memory capacity.   But unable to get Gb value for Linux server



I checked in Linux-Memory probe and made changes in below line but same is not changinng value. Please suggest.




  if (columns[0] == "MemTotal:")


                              ram += parseInt(columns[1]) / 1048576;



Reggards,


Nick


Dave Smith1
ServiceNow Employee
ServiceNow Employee

Tried:


if (columns[0] == "MemTotal:")


ram += parseInt(columns[1]) / 1073741824;


...?


crc2580
Tera Guru

A lot of creative answers here, but I have a simple one for you. Field Transformation: https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/field-administration/...



Literally one of the examples they give for field transformation is for RAM. You set a small script on the field so that it converts post-discovery. Easy to maintain and you do not need to customize Discovery.