Evaluating APM to SAM data transfer

Document ID : KB000116958
Last Modified Date : 04/10/2018
Show Technical Document Details
Introduction:
Data is transferred from APM to SAM using the DCS functionality.  The DCS (Data Coordination Service) transfers data between these two components of IT Asset Manager via web services calls and the APM Event Service.  Occasionally, data may not be received from APM over to SAM.  This may be caused by a variety of reasons, from missing configuration materials to data integrity concerns.  

 
Background:
It is important to note that APM to SAM data transfer has the following requirements:

1. Locations
Location type should be NULL

2. Divisions
Must have at least 1 Division

3. Companies  
Companies must have a company type = internal  
Companies must have a Division  
Companies will not get sent until Divisions have been processed to SAM  

4. Cost Centers  
Cost Center must have a company defined.  
Cost Center will not be sent until Companies have been processed to SAM  

5. Contacts  
By default, Contacts with a contact type = User or Analyst are sent to SAM.  
Contacts MUST have a cost center.  
Contacts MUST have a userid  
Contacts MUST have an email address  
Contacts MUST have a first name and last name  
Contacts will not be sent until Cost Centers have been processed to SAM 
Environment:
CA IT Asset Manager 14.1 and higher
Instructions:
On the MDB Server, run the following queries:

SELECT job_id, status, category, last_update_date FROM arg_job_task order by last_update_date DESC

SELECT job_id, owner, status, last_update_date  FROM arg_job order by last_update_date DESC


One can tweak the above SQL commands to focus on a specific date range, keeping in mind that the date fields of interest, ie  last_update_date are expressed in UNIX date format.

Sample output from arg_job table:
User-added image

Sample output from arg_job_task table:
User-added image

Of interest in both tables is the job_id field.  For example, we see for the result from arg_job table that job_id 1106145 targeted an Individual (contact) and its status shows as "Completed".  Table arg_job_task table shows the same job_id that an INSERT action took place

Going into the CA SAM install directory, we find the following zip file:

 Directory of C:\Program Files (x86)\CA\Sam\app\uploads\prod\data_exchange\superuser\archive
10/04/2018  10:45 AM             1,321 7d5e2bbf1d-0001106145.zip


The Job_id from the above table is the suffix of the zip file that ITAM had sent to SAM for the given job.  7d5e2bbf1d-0001106145.zip

Opening the 7d5e2bbf1d-0001106145.zip in Archive, we find the following content:

User-added image

Opening the 7d5e2bbf1d-0001106145.csv file, we find the content that was being inserted:

"import_id","import_data_source_id","login","import_level_2_id","import_location_id","last_name","first_name","email","is_active","remarks","action"
"9E71B0421DEBEE4EAEA06026C1DC14AF","CASAM","SAMUser1","1000005",,"TestUser","SAM","email1@domain.com","1",,"INSERT"



The log file 7d5e2bbf1d-0001106145.log shows

----------------- Summary -----------------
XML processor file: 0001106145.xml
Start date: 10/04/2018 10:45:48
End date: 10/04/2018 10:45:53
Total duration: 5s
 
----------------- Step 1/1 -----------------
Table: 'users'
Strategy: 'incremental'
Mode: 'single'
File list:
    - 0001106145.csv (UTF-8) (Headline validation: loose; missing columns: import_manager_id, import_user_type_id, import_user_status_id, is_st_user, language, timezone, date_format)
Data sources: none
Restricted import: no
Duration: 5s
 
Statistics:
- 0001106145.csv: 
    Records: 1
    Actions: 1
    Inserted: 1
    Updated: 0
    Unaltered: 0
    Deleted: 0
    Errors: 0


The above confirms a good case in which the insert of a new contact (Individual) was successful in CA SAM.

For a bad case, consider job 1106132 from the above screecaps.  The above arg_job table reports that this job had a "Process Failed" on the Location table and arg_job_task table shows the same status for 3 INSERT and 2 UPDATE attempts.  In the SAM install, we find for job 1106132

 Directory of C:\Program Files (x86)\CA\Sam\app\uploads\prod\data_exchange\superuser\archive
09/28/2018  08:57 AM             1,187 b61bb92269-0001106132.zip


Opening the zip file, the log file enclosed would show:

XML processor file: 0001106132.xml

----------------- Step 1/1 -----------------
Table: 'locations'
Strategy: 'incremental'
Mode: 'single'
File list:
    - 0001106132.csv (UTF-8) (Headline validation: loose)
      tpl-locations-countries-mapping.xml
Data sources: none
Restricted import: no
 
Not processed
 
The following errors occurred:
    <template>: File not found (tpl-locations-countries-mapping.xml) (ASP-I9)


This confirms that the cause of the problem was a missing configuration file  "tpl-locations-countries-mapping.xml" and needs to be placed within the CA SAM install.  The file should be located in the following SAM install location (removed earlier for demonstration purposes)

 Directory of C:\Program Files (x86)\CA\Sam\app\uploads\prod\data_exchange\<USER>\import_templates
10/02/2018  04:56 PM               332 tpl-locations-countries-mapping.xml
Additional Information:
Additional logging instructions to troubleshoot APM/SAM integration:
https://comm.support.ca.com/kb/ca-itam-and-ca-sam-additional-logging-for-dcs-functionality/kb000115460