Object hash settings
In Assets Discovery, an object hash is a unique identifier for objects within Jira Service Management. Object hashes are calculated using the Message-Digest Algorithm 5 (MD5) hashing, which involves concatenating attribute values based on specific configurations defined in the ObjectHashSettings.xml file of the Assets Discovery root path. This file specifies which attributes of an object are used to build the unique hash. Object hashes ensure that each object is uniquely identified, which is crucial for creating or updating objects.
Modifying the ObjectHashSettings.xml file can affect existing data in Assets. For example, changing the attributes used for hashing might generate new object hashes, duplicating objects during data imports.
If you change these settings, you might have to remove manually duplicated or unwanted information. Check how to troubleshoot duplicated objects
Your ObjectHashSettings.xml file might be similar to this:
<!-- VirtualGuestInfo Attributes -->
<VirtualGuestInfo_Name>true</VirtualGuestInfo_Name>
<VirtualGuestInfo_Hostname>true</VirtualGuestInfo_Hostname>
<VirtualGuestInfo_State>false</VirtualGuestInfo_State>
<VirtualGuestInfo_RAM>false</VirtualGuestInfo_RAM>
<VirtualGuestInfo_UUID>true</VirtualGuestInfo_UUID>
<VirtualGuestInfo_ConfigurationFile>false</VirtualGuestInfo_ConfigurationFile>
<VirtualGuestInfo_FirstNICMAC>false</VirtualGuestInfo_FirstNICMAC>
Calculating object hashes
In Assets, object hashes are applied across all object types to ensure accurate and reliable object hash calculation.
For example, the following configuration could serve for calculating CPUInfo objects, where all attribute values are considered since they’re set to true
.
<!-- CPUInfo Attributes -->
<CPUInfo_DeviceID>true</CPUInfo_DeviceID>
<CPUInfo_CPUType>true</CPUInfo_CPUType>
<CPUInfo_CoresPerProcessor>true</CPUInfo_CoresPerProcessor>
<CPUInfo_MaxCPUSpeed>true</CPUInfo_MaxCPUSpeed>
If you run a Discovery Scan, you’ll obtain results that include the ObjectHash
attribute:
<CPUs>
<CPUInfo>
<ObjectHash>4C8070CB0CB1FBE4AEBC125BF31C171B</ObjectHash>
<DeviceID>CPU0</DeviceID>
<CPUType>Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz</CPUType>
<CoresPerProcessor>1</CoresPerProcessor>
<MaxCPUSpeed>2900</MaxCPUSpeed>
</CPUInfo>
</CPUs>
To calculate the object hashes based on settings in your ObjectHashSettings.xml file:
- Concatenate all attribute values set to
true
:CPU0Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz12900
- Prepend the concatenated value with
InternalObjectHash
:InternalObjectHashCPU0Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz12900
- Generate an MD5 hash from the new concatenated value.
The generated hash represents the ObjectHash attribute in the Discovery scan results and might look like this:
4C8070CB0CB1FBE4AEBC125BF31C171B