1 Reply Latest reply on Aug 28, 2012 3:21 PM by Surferseth

    OSX Custom Data to inventory scripting

    Rookie

      I am trying to have the last reboot time added to the inventory via a Custom Data plist. The below script to do this is working.

       

      #!/bin/bash

      # Provides Last Reboot data to LANDesk inventory

      # SurferSeth

      # 08/16/2012

      plistFile="/Library/Application Support/LANDesk/data/ldscan.core.data"

      DateAndTime=$(who -b)

      defaults write "$plistFile" "Custom Data - Last Reboot - Date and Time" "$DateAndTime"

      # fix plist file permissions

      chmod 644 /Library/Application\ Support/LANDesk/data/ldscan.core.data.plist

      chown root:admin /Library/Application\ Support/LANDesk/data/ldscan.core.data.plist

       

      The question is how do I deploy this via LANDesk? Should I use a custom script? I have been trying to create a .pkg file but that didnt seem to work (Tried iceberg, PackageMaker, and Composer). Admittantly I may be creating the package wrong as I have little expierence packaging shell scripts.

       

      I was thinking about using a custom script, like the one below, to run the shell script and then force a inventory scan (either full scan or hardware + software). If I place the shell script on the core server, would the path to file be //LDServerName/scripts/shell.sh or would it be smb://LDServerName/Scripts/shell.sh or /Volumes/Scripts/shell.sh (obviously the voulme would need to be mounted first somehow).

       

      [MACHINES_MACX]

      REMEXEC0=/path/to/my/shell.sh

      REMEXEC1=/Library/Application\ Support/LANDesk/bin/ldscan -F

       

      Am I even going about this the right way? Would a custom data XML file be better if, in the future, we wanted to add more custom data fileds / info?

       

      Thanks!

      SurferSeth