Hi Dave,


Thanks for reply.



In Sensors, I have not found any relevant details but probe is showing below statement about memory capacity



module.capacity                 = parseFloat(Win32_PhysicalMemory.Capacity) / 1048576;


  total_memory += (parseFloat(Win32_PhysicalMemory.Capacity) / 1048576);



Do I need to make the changes here?I am working on production instance. Plz suggest.



Regards,


Nick


Dave Smith1
ServiceNow Employee

Ohhh... that is... actually a tough one.   Will the answer ALWAYS be in GB, or is there a unit against it?



1048576 = 1024 * 1024, giving an answer in MB, so I presume you simply need to change that to "1073741824".   However, I'd write it:



module.capacity                 = parseFloat(Win32_PhysicalMemory.Capacity) / (1024 * 1024 * 1024);



I've just checked that value on this machine (wbemtext.exe rocks!) and got a figure of: 2147483648 (presumably bytes)


  • 2147483648 / 1024 = 2097152 KB
  • 2097152 / 1024 = 2048 MB
  • 2048MB / 1024 = 2 GB


So if you want the answer in GB, instead of "/ 1048576" (which is 1024 squared), you'll need "/1073741824" (1024 cubed, = GB) - give that a whirl, see what happens.


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

Tried:


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


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


...?


View solution in original post

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.