CA Client Automation

 View Only
  • 1.  Please Help - DSM query into file contents

    Posted Nov 16, 2015 02:48 PM

    I am fairly new to queries and scripting beyond basic batch files so I am reaching out here for any help.

     

    Goal:  To create a DSM report the displays PC name, computer description, and specific contents (LU Name=xxxxxxxx) of a file which resides on each computer.

     

    Reason:  To perform an audit of what has been setup per computer to prevent reassignment of duplicate sessions.  These file holds an AS400 session number that has been setup on each PC.  Each PC has two sessions defined.

     

     

    Static File Location:

    #1:  C:\ProgramData\Hummingbird\Connectivity\12.00\HostExplorer\Identity\default.ids3

    #2:  C:\ProgramData\Hummingbird\Connectivity\12.00\HostExplorer\Identity\default2.ids3

     

    Sample of default.ids3 file contents:

    [Identity]

    LU Name=TK06N0PI

     

    Sample of default2.ids3 file contents:

    [Identity]

    LU Name=TL06N0PI

     

    Can anyone help with a script that will look into these two files per PC and pull out the LU Name="xxxxxxxx"?

     

    If I can end up with a report that provides three columns of PC Name, Description, File #1 and File #2 this would solve the entire problem.



  • 2.  Re: Please Help - DSM query into file contents

    Broadcom Employee
    Posted Nov 17, 2015 06:04 AM

    Hi I moved your question to the Client Automation Community.

    I am sure that you will get some speedy responses to this

     

    regards

    Rich



  • 3.  Re: Please Help - DSM query into file contents
    Best Answer

    Posted Nov 17, 2015 09:29 AM
      |   view attached

    The attached script should give you what you need. Create an ‘Asset Job’ for the group of computers you need this to run on, and load this file into it. Set the schedule to whatever frequency you need and don’t forget to check the ‘run unattended’ box on the miscellaneous tab of the scheduling dialog. This script will result in the new items being added as ‘Additional Inventory’ which is at the bottom of the inventory tree. If either of the files is not found, the inventory value for it will be set to ‘File not found’. If the file is found but the variable is not in the file, the value will be set to ‘Variable not found’.

     

    You may note this script is using a function to get data from an INI file. Even though the filename is not .INI, your sample indicated it is in INI format so the function should still work.

     

    Steve McCormick, ITIL

    CA Technologies

    Principal Services Consultant

    Tel: +1-731-676-4223

    Stephen.McCormick@ca.com

    <mailto:Stephen.McCormick@ca.com>

    Attachment(s)

    zip
    Get_LUNames.dms.zip   506 B 1 version


  • 4.  Re: Please Help - DSM query into file contents

    Posted Nov 18, 2015 04:11 PM

    Thank you, that was perfect and generated exactly what I needed.