Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Commodore Commodore
Commodore
485 views

Criteria to remove Retired laptops from Populating into the UCMDB from SNOW

I am using the Enhanced generic adapter for SNOW population and was wondering if there was a way to bring only installed status and only the computer class? I know there is a way but any scripting help would be appreciated. Here is my current mapping script.

 

<target_entities>
        <source_instance query-name="SNOW Computer Population 1.0" root-element-name="cmdb_ci_computer">
            <target_entity name="Root">
                <target_mapping datatype="STRING" name="name" value="cmdb_ci_computer['name']"/>
                <target_mapping datatype="STRING" name="assigned_to" value="cmdb_ci_computer['u_assigned_to_name']"/>
                <target_mapping datatype="INTEGER" name="memory_size" value="cmdb_ci_computer['u_memory_size']"/>
                <target_mapping datatype="STRING" name="sn_sys_id" value="cmdb_ci_computer['sys_id']"/>
                <target_mapping datatype="STRING" name="global_id" value="cmdb_ci_computer['correlation_id']"/>
                <target_mapping datatype="STRING" ignore-on-null="false" name="bios_asset_tag" value="cmdb_ci_computer['asset_tag']"/>
            </target_entity>
        </source_instance>
    </target_entities>
</integration>

5 Replies
Commodore Commodore
Commodore

I attempted this but it didn't work. Ran for a second and didn't give me any info in the logs.

 

 <source_instance query-name="SNOW Computer Population 1.0" root-element-name="cmdb_ci_computer">
            <target_entity name="Root" is-valid="cmdb_ci_computer['install-status'] == 'Installed'">

0 Likes

Install status on the SNOW side is an integer.
Try:
<target_entity name="Root" is-valid="cmdb_ci_computer['install_status'] == '1'">

Here are other values if needed:
/***** Lifecycle States
1 = Installed
2 = On Order
3 = In Maintenance
4 = Pending Installed
5 = Pending Repair
6 = In Stock
7 = Retired
8 = Stolen
100 = Absent
*/
Commodore Commodore
Commodore

I will give that a try. How would I add another validation? I want to also dumb it down to only the computer class.

0 Likes

@tslaneI would recommend changing the TQL that is used for the population job to include the criteria you are looking to import. I would replace your current validation condition with the one I provided. You cannot have more that one validation condition per mapping.

Are you using the older SNOW to UCMDB integration or the Enhanced Generic Adapter?

John

0 Likes
Commodore Commodore
Commodore

So I made the changes but I can't get anything to run. The funny thing is on the ucmdb ui it shows this:

<target_entity is-valid="cmdb_ci_computer['install_status'] == '1'" name="Root">

I move "Root" to where it should be and keeps moving it back.

On the probe server and app server the xml shows it correctly.

<target_entities>
- <source_instance query-name="SNOW Computer Population 1.0" root-element-name="cmdb_ci_computer">
- <target_entity name="Root" is-valid="cmdb_ci_computer['install_status'] == '1'">
<target_mapping datatype="STRING" name="name" value="cmdb_ci_computer['name']" />
<target_mapping datatype="STRING" name="xxxx_assigned_to" value="cmdb_ci_computer['u_assigned_to_name']" />
<target_mapping datatype="INTEGER" name="memory_size" value="cmdb_ci_computer['u_memory_size']" />
<target_mapping datatype="STRING" name="xxxx_sn_sys_id" value="cmdb_ci_computer['sys_id']" />
<target_mapping datatype="STRING" name="global_id" value="cmdb_ci_computer['correlation_id']" />
<target_mapping datatype="STRING" ignore-on-null="false" name="bios_asset_tag" value="cmdb_ci_computer['asset_tag']" />
</target_entity>
</source_instance>
</target_entities>
</integration>

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.