A common use of the Import API is to build an integration with one or more discovery tools. Tools like Microsoft System Center Configuration Manager (SCCM) or HP Network Node Manager (NNM) can discover hard- and software items within a network. Such tools are typically also able to discover some relations between the discovered items. This information can be used to automatically add and update Products, Configuration Items and relations between Configuration Items in 4me.
Integrating with discovery tools
Multiple discovery tools can be integrated with 4me. To ensure that 4me is able to distinguish between different discovery tools, a unique identifier should be chosen for each discovery tool. The identifier of a discovery tool can then be stored in the
Source field of the 4me records that are generated and maintained by this tool. Examples of such identifiers could be SCCM or NNM. Longer names with spaces (up to a maximum of 30 characters) may also be used to populate the
Source field of a record.
It is important to fill out the
Source column for each row when an import file is prepared using data from a discovery tool. In addition, for a Configuration Items import file, the
Source ID column should be set for each Configuration Item to the unique identifier by which the Configuration Item is known within the discovery tool. Having both the
Source ID values stored in 4me makes it possible for a discovery tool to update a Configuration Item record without knowing its
ID (see Create or update).
Before a new Configuration Item record can be registered, a Product record needs to already exist that describes the Configuration Item’s hardware model or software application.
Below an example is provided of how the
Source ID columns of a Products import file could be filled out using data from a discovery tool. Such a Products import file should be imported before Configuration Items are imported to ensure that all the necessary Products are available in 4me.
Source Source ID Name Brand Model Category SCCM Abobe Reader Abobe Reader Adobe software/browser_viewer_application SCCM Microsoft Windows 7 Microsoft Windows 7 Microsoft software/operating_system_software SCCM VMware ESXi VMware ESXi VMware software/operating_system_software SCCM Dell Precision M4400 Dell Precision M4400 Laptop PC Dell Precision M4400 computer/laptop_pc SCCM IBM Power 795 IBM Power 795 Server IBM Power 795 computer/server
After the Products have been imported, the CSV or TSV file with the Configuration Item information can be imported. Before starting the Configuration Items import, however, use the polling feature to make sure that the Products import has completed and that it was successful.
The example below demonstrates how the
Source ID fields can be used in a Configuration Items import file to ensure that Configuration Items can be identified uniquely using data only from the discovery tool.
Source Source ID Product Label Name System ID SCCM AbobeReader9.1.0 Adobe Reader Abobe Reader 9.1.0 SCCM MicrosoftWindows7ProSP3 Microsoft Windows 7 Microsoft Windows 7 Pro SP3 SCCM VMwareESXiBuild164009 VMware ESXi VMware ESXi 4.0 Build 164009 SCCM 01:23:45:67:89:ab Dell Precision M4400 Laptop PC CMP00052 Dell Precision M4400 Laptop PC http://sccm.example.com?mac=0123456789ab SCCM 5691602 IBM Power 795 CMP00207 IBM Power 795 Server http://sccm.example.com?id=5691602
Note that the names without spaces were used to define a
Source ID for the software Configuration Items. This was done to demonstrate how the length of the text string in the
Source ID field, which can contain a maximum of 128 characters, can be reduced.
The example URLs for the
System ID field are hypothetical. The importance of specifying a hyperlink in the
System ID field is explained in the blog post Afraid of the CMDB?
Once the Configuration Items have been imported, the Configuration Item relations can be imported. Again, use the polling feature to make sure that the Configuration Items import has completed and that it was successful.
Source CI Source CI Source ID Related CI Source Related CI Source ID Relation Type SCCM SCCM 01:23:45:67:89:ab SCCM AbobeReader9.1.0 child SCCM SCCM 01:23:45:67:89:ab SCCM MicrosoftWindows7ProSP3 child
If one or more relations are defined for a Configuration Item in the import file and a
Source is specified in the first column for these relations, then all existing relations of that CI with the same
Source will be removed during the import.
Important: Make sure all relations for a Configuration Item are grouped together in the import file. Otherwise the last relation that is specified for a Configuration Item in the import file will cause the previous relations, which were added during the import for that same Configuration Item, to be removed.
Source is not defined for a relation in the import file, then the relation will be added during the import without removing any existing relations.