CA Client Automation

 View Only
  • 1.  Custom MIF Inventory - Populating a Multi-Dimensional Table

    Posted Dec 04, 2017 02:24 PM

    I have created a custom collection module to gather from a vendor specific WMI object, but it was unable to populate some of the values that were of data type string_array (the system simply did not make any entries in the additional inventory for these). What it did populate however, was very nice looking multi-dimension table.

     

    Due to this limitation, I wish to create my own mif with the table syntax, but I do not have an example file to look at. I have reviewed the short paragraph in the manual pertaining to populating tables, but it is not very helpful.

     

    Could someone please provide me a sample mif with a multi-dim table, and also point me to the directory to where my custom collection module would have stored the file it made for my WMI data table (if it is a mif that is)?

     

    On a side note, is there a known list of special characters that the DMS interpreter does not support?

     

    Thank you!



  • 2.  Re: Custom MIF Inventory - Populating a Multi-Dimensional Table

    Broadcom Employee
    Posted Dec 04, 2017 02:31 PM

    FUNCTION WriteMIFTable() As Integer

                   DIM GroupID, i As Integer

     

                   GroupID = CreateMIFGroup(uampath + "patches1.MIF","Patches"," """chr(13)chr(10)" KEY="STR(i2)" //",STR(i+7))

                   CreateMIFString(uampath + "patches1.MIF",GroupID,"Patch Name",patch[j],"")

                   CreateMIFString(uampath + "patches1.MIF",GroupID,"Patch Status",patchstatus[j],"")

                   CreateMIFString(uampath + "patches1.MIF",GroupID,"Install Date",patchdate[j],"")

                   CreateMIFString(uampath + "patches1.MIF",GroupID,"Patch Error",patcherror[j],"")

                   CreateMIFString(uampath + "patches1.MIF",GroupID,"Install Attempts",patchattempts[j],"")

     

    UAMPath is where it I written you must specify it.

     

    END Function

     

    Richard Lechner

    Principal Engineering Services Architect

     

    CA Technologies

    Mobile: +1 703 655 7161 | Richard.Lechner@ca.com

     

    <mailto:Richard.Lechner@ca.com>[CA]<http://www.ca.com/us/default.aspx>[Twitter]<http://twitter.com/CAInc>[Slideshare]<http://www.slideshare.net/cainc>[Facebook]<https://www.facebook.com/CATechnologies>[YouTube]<http://www.youtube.com/user/catechnologies>[LinkedIn]<http://www.linkedin.com/company/1372?goback=.cps_1244823420724_1>[Google]<https://plus.google.com/CATechnologies>[Google+]<http://www.ca.com/us/rss.aspx?intcmp=footernav>



  • 3.  Re: Custom MIF Inventory - Populating a Multi-Dimensional Table

    Posted Dec 04, 2017 03:50 PM

    Thanks Rich,

     

    I have this example already though, the syntax of the CreateMifGroup line seems strange around the Description & Class fields, compared to the reference of that function in the DMS manual.

     

    CreateMIFGroup(Filename as string, Name as string, Description as string, Class as string) as integer

     

     

    I tried to modify this to generate a mif with a table in it, but not having any luck.

     

    Specifically, I am after an actual MIF file with multiple entries in it for a multi-dim-table. This way I can see a working structure of the syntax and start to develop a VBScript to make my own MIF/Tables without using DMScript.

     

    Secondly, do you have any ideas where the system would have saved the file it generated for a custom collection module (showing up under additional inventory, via a new custom version of WBEM Inventory) It is not in the UAM or surrounding directories on the local machines. Would this file happen to be a MIF? It would have the perfect table syntax in it if so.

     

    Thanks,



  • 4.  Re: Custom MIF Inventory - Populating a Multi-Dimensional Table

    Broadcom Employee
    Posted Dec 04, 2017 04:47 PM

    When I get back online later I Will send you a did filled. If you have one on the system it will be in program files x86 ca sms agent units 000001 uam bac

     

     

     

    Sent from my Verizon, Samsung Galaxy smartphone



  • 5.  Re: Custom MIF Inventory - Populating a Multi-Dimensional Table

    Posted Dec 07, 2017 10:28 AM

    Hi Rich, any luck tracking down a table example mif file?

     

    I ended up finding where the system stored the file made from Collection Module > Inventory Detection Module. It was in the UAM folder after all, but the file was named 00033.inv which is why I over looked it before. There appears to be only 1 INV function referenced in DMSL.pdf, SetInvValue, due to this I am not up to speed with .INV syntax and its proper usage.



  • 6.  Re: Custom MIF Inventory - Populating a Multi-Dimensional Table
    Best Answer

    Broadcom Employee
    Posted Dec 07, 2017 01:50 PM

    The mif file itself goes here

    C:\Program Files (x86)\CA\DSM\Agent\units\00000001\uam

     

     

    As the agent runs it convert it to a mnv file by the same name.  The mnv is in inv format.

     

    I have a script that I thought creates a multivariable table but when I ran it to test before I sent it I see it is creating them as additional rows.  When I figure it out I will send it your way.

     

    Here however is a sample mif file

    Start Component

     

    Name = "my first Mif"

    Description = ""

     

    Start Group

     

      Name = "My mif group"

      ID = 1

      Class = "7"

      Description = " "

    KEY=2 //"

     

      Start Attribute

       Name = "First name"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "John"

      End Attribute

     

      Start Attribute

       Name = "Last name"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "Doe"

      End Attribute

     

      Start Attribute

       Name = "City"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "Washington"

      End Attribute

     

      Start Attribute

       Name = "State"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "DC"

      End Attribute

     

      Start Attribute

       Name = "Phone number"

       ID = 1

       Description = ""

      Type = String(64)

       Value = "555 1234567"

      End Attribute

     

    End Group

     

    End Component

     

     

     

     

    Richard Lechner

    Principal Engineering Services Architect

     

    CA Technologies

    Mobile: +1 703 655 7161 | Richard.Lechner@ca.com

     

    <mailto:Richard.Lechner@ca.com>[CA]<http://www.ca.com/us/default.aspx>[Twitter]<http://twitter.com/CAInc>[Slideshare]<http://www.slideshare.net/cainc>[Facebook]<https://www.facebook.com/CATechnologies>[YouTube]<http://www.youtube.com/user/catechnologies>[LinkedIn]<http://www.linkedin.com/company/1372?goback=.cps_1244823420724_1>[Google]<https://plus.google.com/CATechnologies>[Google+]<http://www.ca.com/us/rss.aspx?intcmp=footernav>



  • 7.  Re: Custom MIF Inventory - Populating a Multi-Dimensional Table

    Broadcom Employee
    Posted Dec 07, 2017 02:16 PM

    Here is the multi column mif example.  To run it copy it to this directory C:\Program Files (x86)\CA\DSM\Agent\units\00000001\uam (assuming client auto is installed there and not an alternate location)

    Then run caf start amagent

     

    Wait for the agent to run and the engine to collect it.

     

     

    Start Component

     

    Name = "All Printers by User"

    Description = "Consolidate inventory collected by users"

     

    Start Group

     

      Name = "Printers"

      ID = 1

      Class = "7"

      Description = " "

    KEY=2 //"

     

      Start Attribute

       Name = "User"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "ADMINISTRATOR"

      End Attribute

     

      Start Attribute

       Name = "DeviceID"

       ID = 2

       Description = ""

       Type = String(64)

       Value = "Microsoft XPS Document Writer"

      End Attribute

     

      Start Attribute

       Name = "Driver"

       ID = 3

       Description = ""

       Type = String(64)

       Value = "Microsoft XPS Document Writer"

      End Attribute

     

      Start Attribute

       Name = "Port"

       ID = 4

       Description = ""

       Type = String(64)

       Value = "XPSPort:"

      End Attribute

     

    End Group

     

    Start Group

     

      Name = "Printers"

      ID = 2

      Class = "7"

      Description = " "

    KEY=2 //"

     

      Start Attribute

       Name = "User"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "ADMINISTRATOR"

      End Attribute

     

      Start Attribute

       Name = "DeviceID"

       ID = 2

       Description = ""

       Type = String(64)

       Value = "EPSON Test printer for testing output format of file"

      End Attribute

     

      Start Attribute

       Name = "Driver"

       ID = 3

       Description = ""

       Type = String(64)

       Value = "EPSON LASER LP-8900"

      End Attribute

     

      Start Attribute

       Name = "Port"

       ID = 4

       Description = ""

       Type = String(64)

       Value = "192.168.1.155"

      End Attribute

     

    End Group

     

    Start Group

     

      Name = "Printers"

      ID = 3

      Class = "7"

      Description = " "

    KEY=2 //"

     

      Start Attribute

       Name = "User"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "MCCST05"

      End Attribute

     

      Start Attribute

       Name = "DeviceID"

       ID = 2

       Description = ""

       Type = String(64)

       Value = "EPSON Test printer for testing output format of file"

      End Attribute

     

      Start Attribute

       Name = "Driver"

       ID = 3

       Description = ""

       Type = String(64)

       Value = "EPSON LASER LP-8900"

      End Attribute

     

      Start Attribute

       Name = "Port"

       ID = 4

       Description = ""

       Type = String(64)

       Value = "192.168.1.155"

      End Attribute

     

    End Group

     

    Start Group

     

      Name = "Printers"

      ID = 4

      Class = "7"

      Description = " "

    KEY=2 //"

     

      Start Attribute

       Name = "User"

       ID = 1

       Description = ""

       Type = String(64)

       Value = "MCCST05"

      End Attribute

     

      Start Attribute

       Name = "DeviceID"

       ID = 2

       Description = ""

       Type = String(64)

       Value = "Microsoft XPS Document Writer"

      End Attribute

     

      Start Attribute

       Name = "Driver"

       ID = 3

       Description = ""

       Type = String(64)

       Value = "Microsoft XPS Document Writer"

      End Attribute

     

      Start Attribute

       Name = "Port"

       ID = 4

       Description = ""

       Type = String(64)

       Value = "XPSPort:"

      End Attribute

     

    End Group

     

    End Component

     

    Richard Lechner

    Principal Engineering Services Architect

     

    CA Technologies

    Mobile: +1 703 655 7161 | Richard.Lechner@ca.com

     

    <mailto:Richard.Lechner@ca.com>[CA]<http://www.ca.com/us/default.aspx>[Twitter]<http://twitter.com/CAInc>[Slideshare]<http://www.slideshare.net/cainc>[Facebook]<https://www.facebook.com/CATechnologies>[YouTube]<http://www.youtube.com/user/catechnologies>[LinkedIn]<http://www.linkedin.com/company/1372?goback=.cps_1244823420724_1>[Google]<https://plus.google.com/CATechnologies>[Google+]<http://www.ca.com/us/rss.aspx?intcmp=footernav>