- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 02:40 AM
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
Solved! Go to Solution.
- Labels:
-
Discovery
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 03:15 AM
Tried:
if (columns[0] == "MemTotal:")
ram += parseInt(columns[1]) / 1073741824;
...?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 02:44 AM
Hi Nick,
A simple before update business rule on the table in question
Condition: <RAM field> <changes>
Script
current.<ram>=current.<ram>/1024; //this will convert Mb to Gb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 03:00 AM
Have you checked the sensor for that probe? Changes there may help insert the correct value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 07:08 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 07:22 AM
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.