Client Management Suite

 View Only
  • 1.  Task Status Query

    Posted Dec 06, 2018 02:59 PM
      |   view attached

    I  have many custom inventories that are vb scripts.  I need a query that will enable me to look at the reuslts of the output script on pcs that  show completed but no data written to the table.  The script error is this:

    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\Windows\TEMP\AltirisScript081D01E05BD831A55C.vbs(79, 1) (null): Invalid type for data field

    The script runs correctly, but on some pcs I get this error ( attached screen shot).  I have found the table-TaskOutputPropertyValue- that has some script output values, but not the above. 

    Inventory Script:


    'Create instance of Altiris NSE component

    dim nse

    set nse = WScript.CreateObject ("Altiris.AeXNSEvent")

     

    ' Set the header data of the NSE

    nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"

    nse.Priority = 1

     

    'Create Inventory data block. Here assumption is that the data class with below guid is already configured on server

    dim objDCInstance

    'Modify this class guid to match the one generated when you create the custom data class

    set objDCInstance = nse.AddDataClass ("{64f22255-aa87-44aa-b088-5c1e93bde22f}")

     

    dim objDataClass

    set objDataClass = nse.AddDataBlock (objDCInstance)

     

    'Add a new row

    dim objDataRow

    set objDataRow = objDataClass.AddRow

    'Set columns

    objDataRow.SetField 0, Value

     

    'Wscript.Echo UEFISecureBootEnabled

     

    nse.SendQueued

    ******************************************************

    I am looking for that exact error so that I can try to see why certain pcs fail, perhaps model or something else.

    This is the query :

    SELECT vComputer.Name,

    Item.Name,

    TaskInstanceResults.Result,

    TaskInstanceStatus.InstanceStatus,

    TaskOutputPropertyValue.Value,

    TaskOutputPropertyValue.Name,

    TaskOutputPropertyValue.type,

    vHWComputerSystem.Model

    FROM ( ( ( ( ( ( Symantec_CMDB_OIT.dbo.TaskInstances TaskInstances

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.ItemVersions ItemVersions

    ON (TaskInstances.TaskVersionGuid =

    ItemVersions.VersionGuid))

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.Item Item

    ON (ItemVersions.ItemGuid = Item.Guid))

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.vComputer vComputer

    ON (vComputer.Guid = TaskInstances.ResourceGuid))

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.vHWComputerSystem vHWComputerSystem

    ON (vHWComputerSystem._ResourceGuid = vComputer.Guid))

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.TaskInstanceStatus TaskInstanceStatus

    ON (TaskInstanceStatus.TaskInstanceGuid =

    TaskInstances.TaskInstanceGuid))

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.TaskInstanceResults TaskInstanceResults

    ON (TaskInstanceResults.TaskInstanceGuid =

    TaskInstances.TaskInstanceGuid))

    LEFT JOIN

    Symantec_CMDB_OIT.dbo.TaskOutputPropertyValue TaskOutputPropertyValue

    ON (TaskInstances.TaskInstanceGuid =

    TaskOutputPropertyValue.TaskInstanceGuid)

    where Item.Name = 'Secure Boot Enabled UEFI-Custom Inventory Script'



  • 2.  RE: Task Status Query

    Posted Dec 08, 2018 02:36 PM
    You could use the following How to find task output data in the Symantec cmdb https://www.symantec.com/connect/articles/how-find-task-output-data-symantec-cmdb


  • 3.  RE: Task Status Query

    Posted Dec 10, 2018 09:06 AM

    I have basically used that query to get the one I submitted above.  It does not give me the error message as shown in the attached jpg.  All the failed messages are:

    <string>Altiris.TaskManagement.Common.Execution.Exceptions.TaskKilledByTimeoutException: Exception of type 'Altiris.TaskManagement.Common.Execution.Exceptions.TaskKilledByTimeoutException' was thrown.</string>



  • 4.  RE: Task Status Query

    Posted Dec 10, 2018 11:31 AM

    Are you sure it's the same TaskInstance Guid?



  • 5.  RE: Task Status Query

    Broadcom Employee
    Posted Dec 11, 2018 01:19 AM

    Hi SRJaeger!

    If you don't need other rows from TaskInstance details from your SQL Query, why you didn't add additional operator at the end of your Query.

    Try to use this at the end of your SQL Query (So you will see only saved script output from executed task instance(s)):

    where Item.Name = 'Secure Boot Enabled UEFI-Custom Inventory Script' AND TaskOutputPropertyValue.Name = 'ScriptOutput'

    And don't forget to have enabled "Save script output with task status" option in "Advanced" settings of your created task.

    Regards,

    IP.



  • 6.  RE: Task Status Query

    Posted Dec 17, 2018 11:44 AM
      |   view attached

    IG- Adding that (as above) I get  for the data just  'ScriptOutput'- not the actual output message.  Perhaps I am just not understaind what you are saying.

    Thanks



  • 7.  RE: Task Status Query

    Posted May 24, 2022 10:37 AM

    I know this old, but wanted to share another version of a SQL query that has a Task Job Script output... Hopefully It might be useful to someone.

    SELECT
    vc.name [Computer Name]
    ,vc.[OS Name]
    ,vi.Name [Task Name]
    ,ts.Name [Task Server]
    ,ti.StartTime, ti.EndTime
    ,CAST((ti.EndTime-ti.StartTime) as time(0)) [Total Run Time]
    ,case tis.InstanceStatus
    when 0 then 'Queued'
    when 1 then 'Running'
    when 2 then 'Completed'
    when 3 then 'Failed'
    when 4 then 'Stop Requested'
    end [Status]
    ,tir.Result [Return Code]
    ,topv.Value [Script Output]
    FROM vcomputer vc
    left join Inv_Client_Task_Resources ctr on ctr._ResourceGuid = vc.Guid
    left join vcomputer ts on ts.Guid = ctr.ClientTaskServerGuid
    left join TaskInstances ti on ti.ResourceGuid = vc.Guid AND ti.InstanceType = 1
    left join ItemVersions itv on itv.VersionGuid = ti.TaskVersionGuid
    left join vitem vi on vi.Guid = itv.ItemGuid
    left join TaskInstanceStatus tis on tis.TaskInstanceGuid = ti.TaskInstanceGuid
    left join TaskInstanceResults tir on tir.TaskInstanceGuid = ti.TaskInstanceGuid
    left join TaskOutputPropertyValue topv on topv.TaskInstanceGuid = ti.TaskInstanceGuid
    WHERE (topv.name != '@Exception' OR TOPV.NAME IS NULL) AND
    vi.name like '%CEM%' --<<--- NAME OF TASK SERVER
    ORDER BY ti.EndTime DESC




  • 8.  RE: Task Status Query

    Posted May 24, 2022 10:47 AM
    veeeeeeeeeeeeeery useful! thanks a lot!


    Best Regards / Saludos
    ___________________________

    PABLO LLORENTE ABAD
    EMEA Workplace Services , Workplace Specialist

    Calle Albasanz 14, 4th floor
    Madrid , Spain
    Mobile +34 672746460
    *pablo.llorente@holcim.com <pablo.llorente@holcim.com>**
    <http: www.holcim.com/="">*
    *www.holcim.com <http: www.holcim.com/="">*

    Follow us on Facebook <https: www.facebook.com/lafargeholcimitemea/=""> |
    Twitter <https: twitter.com/lhitemea=""> | LinkedIn
    <https: www.linkedin.com/company/lafargeholcimitemea/="">

    *To visit our Workplace Connect site click here
    <https: connect.lafargeholcim.com/emea-digital-center/functions/it-security/emea-workplace-services="">*

    This email is confidential and intended only for the use of the above named
    addressee. If you have received this email in error, please delete it
    immediately and notify us by email or telephone.