IT Management Suite

 View Only
  • 1.  Custom Inventory - Data Class: How Not overwrite the information?

    Posted Oct 01, 2024 03:48 AM
    Hello,

    I'm trying to capture basic information from my computers and have a
    history on my inventory with that information. Imagine I'm trying to catch
    up to the IP address that my computers have every day. I have created a
    Powershell script to capture it. The PS script works perfectly and gathers
    the information I need. The task is executed with a policy everyday.

    I have created a data class to store the information that I'm capturing,
    but the problem is the information is overwritten every day and I dont know
    how to specify that everyday I should have a new line per
    computer, otherwise I won't have a history of the information.

    In my PS script, I'm creating a variable that is the computername+timestamp
    in order to have a unique computername everyday, and this value is added in
    the data class, so every line should be different.

    Could someone give a clue about how to manage this?

    Best Regards / Saludos


  • 2.  RE: Custom Inventory - Data Class: How Not overwrite the information?

    Broadcom Employee
    Posted Oct 02, 2024 12:13 PM

    Hello Pablo,

    That is a really great question, and exposes a part of ITMS that not many are aware of.  Your Custom Inventory is working the way intended, as each computer reports one set of data into the Inv_CustomDataClass table.  The _resourceGUID column helps with this process, as each computer has their own unique _resourceGUID.  (i.e. select * from 'Inv_YourCustomDataClassName')

    What you're wanting to do would be outside of the limits of Inventory Solution, but there's another way to keep History with ITMS. 

    Use Resource History.  Settings > Notification Server > Resource and Data Class Settings > Resource History.

    Type the name of your Custom Data class in the Search Box on the top right, OR expand Inventory Solution and locate the name of your Data Class. Here are a couple Custom Data Classes I've created.  (Existing KB's show how to create these CustInv's): 

    This process is also documented in KB 181230 

    You would get to pick how long to keep the data (months) and how many rows.

    This new History table would be named InvHist_DataClassName.  You could SQL Join the data together and report on current and also history data in the same report.

    All this said, if the data you're looking for, such as IP Address, is already in other tables in the database collected by Basic Inventory or an Inventory scan i.e. inv_aex_ac_TCP_IP table, you have the option to turn on History for those other Inventory Data Classes.  Searching for TCP, I see that there are 2 tables under Notification Server that match.  Basic Inventory (AeX AC tables) is reported under the Notification Server group in Resource History:

    Run your Inventory task with Resource History enabled for a day or two and see what the results are.

    Hope that helps you use your data!

    Roy




  • 3.  RE: Custom Inventory - Data Class: How Not overwrite the information?

    Broadcom Employee
    Posted Oct 02, 2024 12:39 PM

    One last item.  If you would like to Report on both the Current Data and the History Data, it's necessary to UNION the 2 tables together.  Here is an example using the TPM custom dataclass: 

    select c.Name, tpm.[TPM Ready], tpm.[TPM Present], tpm.[TPM Activated], tpm.[TPM SpecVersion], tpm.[Inventory date]
    from Inv_TPM_Information tpm
    join vComputer c
    on c.Guid = tpm._ResourceGuid

    UNION

    select c.Name, htpm.[TPM Ready], htpm.[TPM Present], htpm.[TPM Activated], htpm.[TPM SpecVersion], htpm.[Inventory date]
    from InvHist_TPM_Information htpm
    join vComputer c
    on c.Guid = htpm._ResourceGuid

    NOTE: both queries in the Union need to return the same number of columns in the Select statement.  SQL will then merge the data from both tables.




  • 4.  RE: Custom Inventory - Data Class: How Not overwrite the information?

    Posted Oct 04, 2024 01:34 AM
    Thanks a lot Roy,

    I just tested it and I confirmed that it is ok for me! Very useful doc!

    In the Inhist_XX table that is created there is a CreatedDate field that
    can be taken as date of data, but the same field does not exist in the
    original table, so for my reports I cannot use the UNION, but is OK taking
    only the Invhist table.

    Thanks again for your help.

    Best Regards / Saludos

    *Get to know IT Security & Internal Control services at EDC **here
    <https: connect.holcim.com emea-digital-center ls content 524980821194687 functions it-security-new>*
    ___________________________

    PABLO LLORENTE ABAD
    EMEA Workplace Services , Workplace Specialist
    EMEA User Lifecycle

    Julian Camarillo 29/31, 2nd floor
    Madrid , Spain
    Mobile +34 661291178
    *pablo.llorente@holcim.com <pablo.llorente@holcim.com>**
    <http: www.holcim.com>*
    *www.holcim.com <http: www.holcim.com>*

    More information at:

    www.itemea.lafargeholcim.com

    Follow us on Facebook <https: www.facebook.com lafargeholcimitemea> |
    Twitter <https: twitter.com lhitemea> | LinkedIn
    <https: www.linkedin.com company lafargeholcimitemea>

    It is great to be great!
    This email is confidential and intended only for the use of the above named
    addressee. If you have received this email in error, please delete it
    immediately and notify us by email or telephone.