3 Replies Latest reply: Dec 10, 2010 2:58 AM by phoffmann RSS

    Query off a non-existing Handle

    Rookie

      I run patch management by using a local scheduler scheduled task to run.  They all have the same handle for patching "1045".  Since SP2, I have had to change the way I push my agents out, as it doesn't like my same code.  Since then, I have a few machines that don't patch on patch night because of this.

       

      I want to run a query to search for all devices without this handle "1045".  My problem is that LANDesk will display all other handles, There are 6-10 handles per device.  Does anyone know a more efficient way to query local scheduled taks that don't exist on workstations or know what I am doing wrong?

       

      Thanks,

        • 1. Re: Query off a non-existing Handle
          phoffmann SupportEmployee

          How confident are you with SQL?

           

          This shouldn't be too hard to figure out - gimme a few minutes.

           

          ============

           

          You know, you could do this via query + column-set as well.

           

          What you need to do is add a query (and a column) for

          ""

          LANDesk Management => Local Scheduler => Scheduled Tasks => Handle = "1045"

          ""

           

          That way, all devices that have a Local Scheduler TaskID (which is what the "handle" is) of 1045 will show up. If you're paranoid, you can even have the command-line be displayed.

           

          The other alternative is digging into the database, but I think the above should make your life sufficiently easy?

           

          - Paul Hoffmann

          LANDesk EMEA Technical Lead

          • 2. Re: Query off a non-existing Handle
            phoffmann SupportEmployee

            As an addendum - if you *ARE* confident with SQL.

             

            Here's a couple of tables for you to look at:

             

            COMPUTER ==> This is where you'll be able to translate COMPUTER_IDN's into device names (we use COMPUTER_IDN's as the identifiers for computers in the rest of the database).

             

            LD_SCHEDULED_TASKS => This is the table that holds the records for the local scheduler tasks as reported by inventory.

             

            If you have a look into LD_SCHEDULED_TASKS, you'll see it's a very straight forward table - you even have whole command-lines in clear text, and the handles are easily visible too in their own column.

             

            All very simple really .

             

            - Paul Hoffmann

            LANDesk EMEA Technical Lead

            • 3. Re: Query off a non-existing Handle
              phoffmann SupportEmployee

              OK - I blame the morning. You want all devices that *DON'T* have local scheduler Task ID 1045. Right.

               

              My bad.

               

              So for that, SQL will be the easiest. Let's throw something together then for you . Here's something very straight forward and not too pretty, but may get the job done.

               

              ""

              select COMPUTER_IDN, DEVICENAME from COMPUTER where COMPUTER_IDN NOT IN

              (select COMPUTER_IDN from LD_SCHEDULED_TASKS where Handle=1045)

              ""

               

              This is an "inverse logic" query. The problem is that we don't have a record for devices that DON'T have a handle of 1045. So what I do is I make a query for all devices that *DO* have handle ID 1045, and use this query as a "list me all computers that AREN'T in this list") type of deal.

               

              You could, if you wanted to, also muck about just straight up querying for the command-line or filters you've wanted / set up, but this could be a decent starting point.

               

              - Paul Hoffmann

              LANDesk EMEA Technical Lead