Mac Management Group

 View Only
  • 1.  Custom Inventory to capture the Model Identifier

    Posted Mar 25, 2015 04:11 PM

    Greetings,

     

    So I'm trying to create a custom inventory that would capture Macs model identifier -i.e. MacBookPro9,2.-

    I created a custom data class and named it Model_Identifier. I also added just one Attribute called Model and did not make it key or required.

    I'm getting really stuck on getting a script going. This is what I have so far:

    . `aex-helper info path -s INVENTORY`/lib/helpers/custominv_inc.sh
    #
    # Sample script for custom inventory
    # The first line of code should be always included at the begin of the script
    # Actual script for collecting inventory data begins after the following label:
    # SCRIPT_BEGINS_HERE
    #!/bin/sh

    echo Model_Identifier
    echo "Delimiters=\" \" "
    echo string50
    echo model
    sysctl hw.model | awk '{print $2}'

     

    It completes successfully but it never adds anything to the database.

    Any help is greatly appreciated!



  • 2.  RE: Custom Inventory to capture the Model Identifier
    Best Answer

    Posted Mar 26, 2015 08:15 AM

    Greetings,

    I've tried to reproduce your scenario and actually succeeded to gather custom inventory and collected info became nicely visible on Console side.

    I created client task by copy-pasteing your custom inventory script as you posted it and defined 'Model_Identifier' Custom Inventory data class with single attribute:

    Name: model

    Data type: string

    Maximum size: 50

    Key: yes

    Data required: yes

    Probably problem is in the settings 'Key' and 'Data required' which should be 'yes', but yours were set to 'no'.

    Try to change them in the data class setup and re-run task again on your Mac computer(s).

    Another possible problem: do you have valid Inventory solution license installed? Custom Inventory consumes Inventory license in the same way as standard agent-based Inventory does. 

    Thanks.

     



  • 3.  RE: Custom Inventory to capture the Model Identifier

    Posted Mar 26, 2015 11:33 AM

    Working now! It was the Data and key required suggestion that did it.

     Thanks again!