Highlighted
Absent Member.. Absent Member..
Absent Member..
171 views

DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI's

Jump to solution

Hi

 

I have tried to use the DBPush example, to extract selected CI's and their relation.

 

I have tried to use the xml mapping file, to define two CI's to pull data from to one target.

My result is at best a line for each CI (objectID) in the Database.

 

As far as I understand, this is the key challenge for me. the objectID, I can't seem to get any function out of changing the primarykey in the mapping, the ID related to the COUNTER seem to stick. (the jython script also uses hardcoded where clause on update, that uses the ID)

 

An example of my wanted result:

UCMDB CI's created for the TQL = nt(root) - containment - IpAddress

Mappings = nt(root) -> WindowsPrimary (SQL table manually created, WindowsGlobal_id) and IpAddress -> WindowsPrimary (SQL table manually created, with attribute IpAddressGlobal_id)

 

my log from the probe says it registers different objects, which gives different lines in the table, e.g.

ID   |   WindowsGlobal_id  | IpAddressGlobal_id

1          23kni h245o 225..               null

2            null                                  frg22 23fff4 df2...

 

Is there any way of getting the result    :

ID   |   WindowsGlobal_id  | IpAddressGlobal_id

1          23kni h245o 225..               frg22 23fff4 df2...

or  with a different table                              

 WindowsGlobal_id  | IpAddressGlobal_id

 23kni h245o 225..               frg22 23fff4 df2...

 

 

An alternative, as far as I can read in the developer guide, is to use the enhanced, but I cannot seem to find a working example within the packages available to UCMDB 10.10 CUP2.

 

 

Best

Daniel

                      

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI

Jump to solution

Hello,

 

You should change your mapping file. It should be like this:

 

<source_ci_type name="ssh" mode="update_else_insert">

<target_ci_type name="UCMDB_NODE">

<targetprimarykey/>

 

<target_attribute name="RSNAME" datatype="char" length="255" option="uppercase">

<map type="direct" source_attribute="name"/>
</target_attribute>


<target_attribute name="RSDESCRIPTION" datatype="char" length="255" option="uppercase">
<map type="direct" source_attribute="data_note"/>
</target_attribute>


<target_attribute name="NAME" datatype="char" length="255" option="uppercase">
      <map type="parentattr">
              <source_child_ci_type name="node" source_attribute="name"/>
      </map>
</target_attribute>

 

</target_ci_type>

</source_ci_type>


In my case I have a TQL with node->ssh . The ssh CIT is the root in the TQL. Use above mapping and you should have the result you want.

 

If you feel we need more examples on push adapter(old or enhanced) please submit an ER .

 

Please mark it as solved if it answers your question.
 
Best Regards,
Gabi Medan

View solution in original post

0 Likes
5 Replies
Highlighted
Super Contributor.
Super Contributor.

Re: DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI

Jump to solution
Hello Daniel,

The reason why you are getting 2 different IDs is becasue the node and the IP are 2 different CIs and they will have 2 different IDs
HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI

Jump to solution

Hello,

 

You should change your mapping file. It should be like this:

 

<source_ci_type name="ssh" mode="update_else_insert">

<target_ci_type name="UCMDB_NODE">

<targetprimarykey/>

 

<target_attribute name="RSNAME" datatype="char" length="255" option="uppercase">

<map type="direct" source_attribute="name"/>
</target_attribute>


<target_attribute name="RSDESCRIPTION" datatype="char" length="255" option="uppercase">
<map type="direct" source_attribute="data_note"/>
</target_attribute>


<target_attribute name="NAME" datatype="char" length="255" option="uppercase">
      <map type="parentattr">
              <source_child_ci_type name="node" source_attribute="name"/>
      </map>
</target_attribute>

 

</target_ci_type>

</source_ci_type>


In my case I have a TQL with node->ssh . The ssh CIT is the root in the TQL. Use above mapping and you should have the result you want.

 

If you feel we need more examples on push adapter(old or enhanced) please submit an ER .

 

Please mark it as solved if it answers your question.
 
Best Regards,
Gabi Medan

View solution in original post

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI

Jump to solution

Thanks, I will have a look at it later, i'm at a HP UCMDB course, so AFK, unfortunatly

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI

Jump to solution

Thank you so much Gabi! It worked...

 

Where do you find these "functions" for the xml mapping? and do you know of any documentation of how to use them?

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: DB push adapter - get result from 2 Ci's and dump in to one table with respect to relation of CI

Jump to solution

Hello,

 

As far as I know there is no documentation available for customers.  Creating an ER to provide more examples about push adapter is the right approach .

 

Best  Regards,

Gabi Medan

0 Likes
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.