cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

programatically setting status to dispose

Is there a way to use Chef or other infra as code tool to set a hardware asset to disposed and the inventory to ignored as part of a Chef deconstruction process?  

I think it would be preferred to use an API to interact instead of directly accessing the database to do so.

(1) Solution

From what I know, the only current method to change data in assets or discovered assets is using a business adapter. 

 

With that, you could generate a file for upload and manage the run of the business adapter with you orchestration tool. 

View solution in original post

(5) Replies

From what I know, the only current method to change data in assets or discovered assets is using a business adapter. 

 

With that, you could generate a file for upload and manage the run of the business adapter with you orchestration tool. 

mfranz
By Level 17 Champion
Level 17 Champion

Hi,

If you would like to decouple the database access a bit, you could write a tiny PowerShell funtion to use with your tool.

Best regards,

Markward

Would the powershell script change the status in the database directly?  As example find the host name + SN and set status to Disposed in the table.  Would this show up in the history?

We have a daily export of asset status from our asset tool to a staging database, and then have a scheduled task running the business adapter tool to import the asset status from the staging database into the FNMS database. When an asset is marked as disposed in our asset tool, within a day or two the asset status is automatically updated in FNMS and inventory set to ignored.

There is some knowledge required to configure the business adapter studio, our was setup by Flexera services during our implementation.

Post-setup the biggest challenges we face are data accuracy issues, ie the serial number is missing/incorrect/duplicated in our asset tracking tool, but when the data is correct it works pretty well.

Yes, the PowerShell script would then run SQL directly on the DB to make the changes. But it could be an extra abstraction layer, if designed correctly. In your example, you could make $ComputerName and $SerialNumber mandatory parameters for the function.

Also you could create your own stored procedures in the database to make the process oven more robust. You could grant access to these specific procedures only. A specific set of stored procedures could work just like an API.