How to fetch Windows CPU Core Count from AWSIssue The CPU Core Count is not getting populated by the SG AWS. But in the document, it is mentioned that SG AWS will bring the CPU Core Count.ReleaseAll ReleasesResolutionWe won't get the data from AWS for the field with the name 'cpu_core_count' We will get the value for the field CPUCores. After getting the data into the staging table, the below OnStart Script runs and appends the value of CPUCores to 'cpu_core_count'. Once the transformation process starts, we can see that there is an onStart Script that was configured to run at the start of every transform. This script is responsible for updating the source fields like 'CPUCores' into the target fields like 'cpu_core_count'; The below is the Script-Include: https://instance.service-now.com/sys_script_include.do?sys_id=68a7d4945371411051f9ddeeff7b12b4 Script Include Script: updateComputerHwAttributes: function(cpu, sysId) { var gr = new GlideRecord('cmdb_ci_computer'); gr.addQuery("sys_id", sysId); gr.query(); if (gr.next()) { var hardwareModelObj = new sn_cmdb_int_util.CmdbIntegrationHardwareModelUtil().cleanseModelAndCompany(cpu.Manufacturer, cpu.ModelId, gr.getValue('sys_class_name')); if (!gs.nil(hardwareModelObj.companySysId)) { gr.setValue('manufacturer', hardwareModelObj.companySysId); } if (!gs.nil(hardwareModelObj.modelSysId)) { gr.setValue('model_id', hardwareModelObj.modelSysId); } gr.setValue('serial_number', cpu.serialnumber); var company_sys_id = this.getSysIdOfRefField(cpu.Manufacturer, 'core_company'); gr.setValue('cpu_speed', Math.round(parseFloat(cpu.CPUSpeed))); gr.setValue('ram', parseInt(cpu.ramInMB)); gr.setValue('disk_space', parseInt(cpu.diskSizeinGB)); if (!gs.nil(cpu.hostName)) { gr.setValue('name', cpu.hostName); gr.setValue('host_name', cpu.hostName); } if (!gs.nil(cpu.Vendor)) { var manufacturer_sys_id = this.getSysIdOfRefField(cpu.Vendor, 'core_company'); gr.setValue('cpu_manufacturer', gs.nil(manufacturer_sys_id) ? '' : manufacturer_sys_id); gr.setValue('cpu_type', cpu.Vendor); } else { gr.setValue('cpu_type', gs.nil(cpu.CPUManufacturer) ? '' : cpu.CPUManufacturer); } gr.setValue('cpu_count', gs.nil(cpu.CPUCount) ? '' : cpu.CPUCount); gr.setValue('cpu_name', gs.nil(cpu.CPUName) ? '' : cpu.CPUName); gr.setValue('cpu_core_thread', gs.nil(cpu.CPUCoreThreads) ? '' : cpu.CPUCoreThreads); gr.setValue('cpu_core_count', gs.nil(cpu.CPUCores) ? '' : cpu.CPUCores); gr.update(); } }, There are ways to deal with the issue: ===>Scenario 1: The data is currently not reaching the staging table in ServiceNow. 1)For AWS, we use SSM commands to collect CPU details. A PowerShell script is provided to execute within AWS, which gathers the required data and stores it in an S3 bucket. This data is then retrieved using an API triggered by the AWS Data Source in ServiceNow. 2)First, we need to verify on the AWS side whether the required fields (e.g., CPU details) are being successfully captured and stored in the S3 bucket. 3)If the CPU cores information is not appearing in the S3 bucket, we need to confirm whether this data is available in AWS at all. 4)If the data is present in the S3 bucket but not reaching ServiceNow, we should enable outbound debugging logs in the instance to investigate why the data is not being imported into the staging table. ===>Scenario 2: 1)We are able to get the data into the Servicenow in the staging table but the same data is not getting transformed into the target table fields. 2)We need to check whether the below data source and transform map are active and the transform map is triggering the above script include. 3)Need to go for gs.log statements in the Script include to isolate the issue is not with the script include. -->We attached a zip file in which you will be able to find a script with name --SG-AWS-RunPowerShellScript-Setup.yml ===>We can use the 'the SSM SendCommand API' via the Data Source 'SG-AWS-SSM-SendCommand'At a high level, here is the flow to execute commands and get the data into the CMDB:SG-AWS makes the SSM SendCommand API call to execute custom SSM Document defined by SG-AWS.SSM executes custom SSM Document script in a EC2 instance.EC2 executes the command and publishes the output into the common/centralized S3 bucket.SG-AWS then invokes files generated in S3 bucket and parse the command output and populates the relevant CMDB data. SG-AWS then deletes the files in S3 and completes the process.Sample Script will be as follows:The following is the script 'SG-AWS-RunPowerShellScript-Setup.yml' defined in the SSM Documents for Windows; AWSTemplateFormatVersion: 2010-09-09Resources: SSMDocument: Type: 'AWS::SSM::Document' Properties: Content: schemaVersion: '2.2' description: 'Service Graph AWS - aws:runPowerShellScript' mainSteps: - action: 'aws:runPowerShellScript' name: runPowerShellScript inputs: timeoutSeconds: '3600' runCommand: - 'echo ''####SG-AWS-06-02-2022####''' - 'echo ''####-WINDOWS-####''' - wmic bios get serialnumber | foreach {"###SERIAL###"+ $_} - netstat -anop TCP | foreach {"###TCP###"+ $_} - cmd /a /c 'wmic computersystem get model,name,systemtype,manufacturer,DNSHostName,domain,TotalPhysicalMemory,NumberOfProcessors /format:list' | foreach {"###CS###"+ $_} - cmd /a /c 'wmic cpu get Manufacturer,MaxClockSpeed,DeviceID,Name,Caption /format:list' | foreach {"###CPU###"+ $_} - cmd /a /c 'wmic process get ProcessId, ParentProcessId, Name, ExecutablePath, Description, CommandLine /format:rawxml' | foreach {"###PS###"+ $_} - (Get-Disk | measure-object -Property size -Sum).Sum / 1GB | foreach {"###DISK###"+ $_} - (Get-WmiObject Win32_PhysicalMemory | measure-object Capacity -sum).sum/1gb | foreach {"###RAM-GB###"+ $_} DocumentType: Command Name: SG-AWS-RunPowerShellScript VersionName: '1.0' We will be getting the output for CPU like: {"cpu":{"Manufacturer":"xxx","ModelId":"xxx","serialnumber":"xxxxxxxx","CPUManufacturer":"xxxxxxx","model name":"xxxxxxxx","CPUSpeed":"xxxxxxx","cpu cores":"n","Vendor":"xxxxx","CPUName":"xxxxxx","CPUCount":"n","CPUCores":"1","CPUCoreThreads":"n","ramInMB":nnn,"diskSizeinGB":"nn"},"connection_alias_id":"xxxxxxxxxxxxxxxxxxxxxx"} Data Source: https://instance.service-now.com/sys_data_source.do?sys_id=56c1ff81533f821055bbddeeff7b123b&sysparm_record_target=sys_data_source&sysparm_record_row=26&sysparm_record_rows=32&sysparm_record_list=sys_scope%3Ddce0e45cdbf6e010359586171b961928%5EORDERBYname