3 Replies Latest reply on Aug 5, 2017 2:03 PM by phoffmann

    Run a script before ldscan on a Mac?

    msalmon Apprentice

      I don't see a lot of info online about this topic.

      I want to know if it's possible to kick off a script every time the ldscan automatically runs.  I'd like to use this method to dynamically update a custom inventory xml file.  This method is baked into Windows using ldscnhlp.ini (old method, I know, but works), I don't see how to do this on a Mac unless I'm utilizing something like a cron or a launch daemon.  Maybe it's related, I see there is a scripts folder in "/Library/Application Support/LANDesk/scripts", not sure what's that used for.

      I could also create a daily landesk Scheduled Task too, maybe that would be the best option...

      How does everyone else do this?

        • 2. Re: Run a script before ldscan on a Mac?
          msalmon Apprentice

          Thank you for the reply Peter.  I did come across this article which does a great job detailing writing a shell script to creating the ldscan.core.data.plist.  The article states to execute the shell script as a reoccuring task in LANDesk.  Maybe this is the best way, but i was hoping for a way the local computer itself could execute the shell script as it's running ldscan, so basically every time the inventory scan runs, it kicks off the shell script before hand so the inventory always has the latest data.  Maybe I'm just over thinking things.

          • 3. Re: Run a script before ldscan on a Mac?
            phoffmann SupportEmployee

            Not really possible to my knowledge, beyond having a custom data file (i.e. - plist) already there for the scanner to pick up.


            What you're after is essentially a pre-scanner execution / inject of a binary / shell ... which we don't have (and probably for the better). The scanner will just pick up custom data files that exist ... it's easy enough to just run those regularly (1x day/week/month ... depends on what you're after). You can just run it as part of a regular cron-job.


            There's two ways that we tackle this ourselves (on NIX, rather than MAC, but essentially the same):

            • Option 1 - create custom data files using custom vulnerabilities. You can create "anything" in custom vulnerabilities, so you can script bash-based custom data files as well .
            • Option 2 - call the inventory scanner via a script -- which in turn *FIRST* creates/updates custom data and then runs the actual inventory scanner.


            Option 1 is useful for "if ... then..." scenarios -- i.e. "if you have custom hardware X, collect data points 1, 2 and 3". Whereas option 2 is usually more beneficial for stuff you want to collect from everywhere (think "Org unit" type stuff).