IT Management Suite

 View Only
  • 1.  Get output information from Ubuntu machine into ITMS SQL

    Posted Jul 05, 2020 08:16 AM

    Hello,

    we have a image type flg in our Ubuntu images.

     

    We are tryingto get that flg into the ITMS.

     

    How can it be done?

     

    (in windows, you create this procedure by following this guide: <https://knowledge.broadcom.com/external/article?legacyId=HOWTO124425>

     

    But we can't find a similar solution for linux (Ubuntu).

     

    Any idea?

     

     

     

    Thanks,

     

    Hagai Nachmani,

     

    ---------------------------------------------------------------------
    A member of the Intel Corporation group of companies

    This e-mail and any attachments may contain confidential material for
    the sole use of the intended recipient(s). Any review or distribution
    by others is strictly prohibited. If you are not the intended
    recipient, please contact the sender and delete all copies.



  • 2.  RE: Get output information from Ubuntu machine into ITMS SQL

    Posted Jul 05, 2020 08:28 AM
    You could use a custom inventory, I'd imagine.

    https://help.symantec.com/cs/ITMS8.0/INVENTORY/v17356799_v116337854/Creating-a-custom-inventory-script-task?locale=EN_US

    Once that's complete, and you've run the custom inventory script on your Ubuntu machines, the data should be in a SQL table named Inv_{custom_data_class_name}

    NOTICE: This message is confidential, intended for the named recipient(s) and may contain information that is (i) proprietary to the sender, and/or,(ii) privileged, confidential and/or otherwise exempt from disclosure under applicable Florida and federal law, including, but not limited to, privacy standards imposed pursuant to the federal Health Insurance Portability and Accountability Act of 1996 ("HIPAA"). Receipt by anyone other than the named recipient(s) is not a waiver of any applicable privilege. Thank you in advance for your compliance with this notice.





  • 3.  RE: Get output information from Ubuntu machine into ITMS SQL

    Posted Jul 06, 2020 04:36 AM
    hello,
    i think i need to narrow my question:

    i created a data custom names "Test" , it created a table in the SQL named: "dbo.Inv_Test"

    now from that Ubuntu i know what information i am trying to gather, by using "cat \etc\issue*"

    my question is:

    how can i take the output from "cat \etc\issue*" and inject it to the "dbo.Inv_Test", what is the unix bash script that is needed to be done?

    we've tried this, the command completes successfully, but it's not actually writing the content into anywhere:
    #!/bin/bash -x
    # check that tag-file exists
    TF="/etc/issue*"
    if [ -z $TF ] ; then
    Test=$(cat $TF)
    else
    Test="Generic Linux Image"
    fi
    exit $Test


    am i missing something? 

    by any chance did anyone encounter such a request before?

    tnx

    Hagai Nachmani


  • 4.  RE: Get output information from Ubuntu machine into ITMS SQL

    Broadcom Employee
    Posted Jul 07, 2020 10:41 AM
    Here's an example you can modify to fit the data you are collecting above:

    1. Following is a sample shell script for Unix, Linux and Macintosh custom inventory.

      ## Sample script for Unix, Linux and Macintosh custom inventory
      . `aex-helper info path -s INVENTORY`/lib/helpers/custominv_inc.sh
       
      # The custominv_inc.sh inclusion is required at the begin of the script, prior to any other custom inventory logic.
      # The following comment/label is also required to mark the beginning of the custom inventory logic.
      # SCRIPT_BEGINS_HERE
       
      #!/bin/sh
      echo UNIX_PS_List
      echo "Delimiters=\" \" "
      echo string20 string20 string20 string256
      echo PID Terminal Time Command
      if [ "`uname -s`" = "Darwin" ] ; then
      	ps -ax | sed -e "1d" | awk '{print $1 " " $2 " " $4 " " $5 " " }'
      else
      	ps -e  | sed -e "1d" | awk '{print $1 " " $2 " " $3 " " $4 " " }'
      fi

    This code does the following:

    1. Include a file required to format the data.
    2. Specify the data class.
    3. Specify delimeters for use in parsing the data returned from the command to be executed.
    4. Specify the datatypes and lengths of each column.
    5. Specify the column names. Note: this is only required when the command to be executed does NOT already include column headings.
    6. Run the desired command. In this case, we check for and run appropriate platform-specific commands.



  • 5.  RE: Get output information from Ubuntu machine into ITMS SQL

    Posted Jul 07, 2020 10:44 AM
    Thank you, will try it.
    tnx,

    Hagai Nachmani


  • 6.  RE: Get output information from Ubuntu machine into ITMS SQL

    Posted Jul 08, 2020 01:59 PM
    Thank you , it worked! (needed a help of a UNIX guy to help me understand the context, but it worked! :) ) happy days! :)


  • 7.  RE: Get output information from Ubuntu machine into ITMS SQL

    Posted Jul 08, 2020 10:00 AM
    Edited by Hagai Nachmani Jul 08, 2020 10:05 AM
    still have some issues, but will try and report back, thanks :)