Adrian Simpkins Posted August 10, 2022 Posted August 10, 2022 Hi All, We have a requirement where we want our engineers to update certain data fields in issued assets. We have our daily interface into our SCCM pulling in the asset data. However our engineers work a large number of requests daily where they then have to update the asset data. Rather than having to manually go into each asset our idea would be to load this data to a spreadsheet instead, and upload this on probably a daily basis. Currently the csv upload facility just creates assets, and there is no update to existing asset function (this is available of course within the actual SCCM interface config). Would it be possible to enhance the csv functionality to allow for update and creation of assets please? Many thanks
Frank Reay Posted August 10, 2022 Posted August 10, 2022 Adrian - note that the Database Asset Import (v3) does allow Update and/or Create:OperationType - The type of operation that should be performed on discovered assets - can be Create, Update or Both. Defaults to Both if no value is provided I haven't moved to the new version yet but I think as long as you specify the Asset Type (which is the problem for me as the system creating the incoming csv file doesn't have that info) then it will update an existing record rather than create a duplicate. 1
Adrian Simpkins Posted August 10, 2022 Author Posted August 10, 2022 Ah thanks Frank - I did not notice the new version allowing the option to update and create - thank you for highlighting it (sometimes hard to take on board all changes when its just little old me ha) I will take another look Many thanks !
Frank Reay Posted August 10, 2022 Posted August 10, 2022 I know the feeling! Bob sent me a really useful mail a while ago! 1
Steve Giller Posted August 10, 2022 Posted August 10, 2022 For anyone not familiar with the Database Asset Import the documentation is here. 1
Carl Reeder Posted September 30, 2022 Posted September 30, 2022 New to the Asset import tool. However I am struggling to see, from the templates, how data is imported from a csv file. Do you have any examples that I could look at. I don't understand the difference (and/or what fields I need) for AssetGenericFieldMapping and AssetTypeFieldMapping - I am trying to rename the Name of the asset using the two attached files. ReloadName.csv conf_ReloadName_csv.json
Carl Reeder Posted September 30, 2022 Posted September 30, 2022 Have now set APIKey and InstanceID correctly but am still getting the following message: PS C:\asset_import> ./goDBAssetImport -dryrun=true -file=.\conf_ReloadName_csv.json [ERROR] Error Decoding Configuration File: read C:\asset_import/: The handle is invalid. [ERROR] Unable to retrieve endpoint information for the supplied InstanceID: PS C:\asset_import>
Frank Reay Posted September 30, 2022 Posted September 30, 2022 a tip for you in case it helps - the instanceID is case sensitive so you will probably find it needs to be all lower case. That 'gotcha' kept me busy for days :-(
Carl Reeder Posted September 30, 2022 Posted September 30, 2022 Thank you - have checked and both are all lowercase.
Frank Reay Posted September 30, 2022 Posted September 30, 2022 In which case you need to be certain you have a valid active API Key (against a user with the appropriate access levels eg admin) and the correct InstanceID both with double quotes around them and a comma at the end.
Carl Reeder Posted October 3, 2022 Posted October 3, 2022 It appears to run now (Maybe had to wait for permissions to filter) - however fails to update any records. Have you got any examples of a simple json file and csv file? I don't think I have the AssetGenericFieldMapping and/or AssetTypeFieldMapping set quite right. Not sure I understand the difference and how they work. Current binary is the latest version: 3.3.0 ---- XMLMC Database Asset Import Utility v3.3.0 ---- [DEBUG] Flag - Config File conf_ReloadName_csv.json [DEBUG] Flag - Dry Run false [DEBUG] Flag - Concurrent 1 Caching Application Records from Hornbill... Running CSV query for BASE assets. Please wait... 1 of 1 returned assets successfully retrieved ready for processing. Caching BASE Asset Records from Hornbill... 4471 / 4471 [=============================================================================================] 100.00% 0s Hornbill BASE Asset Records Cached Processing 1 of BASE Type Assets... 1 / 1 [===================================================================================================] 100.00% 0s BASE Asset Type Processing Complete! -=-=-= Summary =-=-=- Created: 0 Create Skipped: 0 Create Failed: 0 Updated: 0 Update Skipped: 0 Update Failed: 0 Update Extended Record Skipped: 0 Update Extended Record Failed: 0 Assets Software Inventory Skipped: 0 Software Records Created: 0 Software Records Create Failed: 0 Software Records Removed: 0 Software Records Removal Failed: 0 Asset Supplier Associations Success: 0 Asset Supplier Associations Failed: 0 Asset Supplier Associations Skipped: 0 Asset Supplier Contract Associations Success: 0 Asset Supplier Contract Associations Failed: 0 Asset Supplier Contract Associations Skipped: 0 Time Taken: 3s ---- XMLMC Database Asset Import Complete ----
Steve Giller Posted October 3, 2022 Posted October 3, 2022 28 minutes ago, Carl Reeder said: I don't think I have the AssetGenericFieldMapping and/or AssetTypeFieldMapping set quite right. While this is the case, please ensure you keep the dryrun flag set to true. 28 minutes ago, Carl Reeder said: Not sure I understand the difference and how they work. AssetGenericFieldMapping are the values that apply to all assets, these are stored in the h_cmdb_assets table and are discussed here.AssetTypeFieldMapping are specific to the asset type, these are stored in the various h_cmdb_assets_basic_[type] tables and are discussed here. Sample JSON configurations are also given on the wiki page 35 minutes ago, Carl Reeder said: Running CSV query for BASE assets. Please wait... Have you created an Asset Type of BASE? This is not a default Asset Type, so if not the import will not work.
Carl Reeder Posted October 4, 2022 Posted October 4, 2022 Some success thank you have managed to update one field in a record. Where can I find the table structure to see how the tables relate to each other? So we have Asset Tag under financial information - but how can I check that this relates to h_asset_tag in the tables and not a reused field?
Steve Giller Posted October 4, 2022 Posted October 4, 2022 The Entity Explorer under the Service Manager Admin section will have all of the relationships. You will also be able to check the Data Types for the various fields here, too.
Carl Reeder Posted October 5, 2022 Posted October 5, 2022 I have admin rights to the system but can't see the Entity Explorer. Do I need some other rights as well?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now