Symantec Management Platform (Notification Server)

 View Only
  • 1.  How do I get the status of a Windows Service in an Altiris report?

    Posted Mar 08, 2017 04:32 AM

    Dear All,

     

    I am trying to work out what the status of a Windows Service is on many machines interactively. I have created a Service Control State Client Task and I have executed it on the machines in question, as below:

    2017-03-07_17h19_03.png

    What I need, though, is to know the result of the execution via a report, such as I can know WHEN the Service Control task is successfully completed and what is the status of the Service, ie. Running or Stopped. I can get to the result in the Web Console, such as here:

     

    2017-03-07_17h24_47.png

    Usually, I can find these things in the database, but I cannot find in which table and field that the Output Properties are for the Task in the CMDB, but I have drawn a blank at the moment.

    Does anyone know how I can get this, please?

     



  • 2.  RE: How do I get the status of a Windows Service in an Altiris report?

    Broadcom Partner
    Posted Mar 08, 2017 09:01 AM
      |   view attached

    Hi QuietLeni,

    There are multiple ways of monitoring a service.. I assume you are not using Monitoring Solution - but you can do this with custom inventory..


    In the attachement you will find instruction how to do this with Print Spooler Service just modify the script to fit your needs...

    Network23

    Attachment(s)



  • 3.  RE: How do I get the status of a Windows Service in an Altiris report?
    Best Answer

    Posted Mar 08, 2017 10:32 AM

    Hi,

     

    Try the query you find here:

     

    https://www.symantec.com/connect/articles/how-find-task-output-data-symantec-cmdb

     

    -- Find task instances by task name. Show completion status and output text
    
    -- Provided as-is by Symantec
    
    -- Written by Doug Jenkins, April 21, 2015
    
    --
    
    -- To use, simply copy a task name in the '@TaskName field, below, and execute the script.
    
    -- The output can be further refined by adding a computer name. 
    
     
    
    Declare @TaskName varchar(255)
    
    Declare @ComputerName varchar(255)
    
    Set @TaskName = 'Get the Status of the SMP PXE Service'
    
    Set @ComputerName = '%'
    
     
    
    select    vc.name 'Client Name'
    
            , i.name 'Task name'
    
            , tir.endtime 'Instance EndTime'
    
            , case tis.instancestatus
    
                when 0 then 'Not started'
    
                when 1 then 'Started'
    
                when 2 then 'Completed'
    
                when 3 then 'Failed'
    
                when 4 then 'Stop Requested'
    
                else 'unknown'
    
              end 'Instance Status'
    
            , topv.value 'Instance Output Text'
    
      from item i 
    
      join itemversions iv on iv.itemguid = i.guid
    
      join taskinstances ti on ti.taskversionguid = iv.versionguid
    
      join vcomputer vc on ti.resourceguid = vc.guid
    
      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 
    
        i.name like @TaskName
    
        and vc.name like @ComputerName
    
      order by tir.endtime, i.name  --, v.name --, iv.version,
    
    ====================

    Regards

    Stefan

     



  • 4.  RE: How do I get the status of a Windows Service in an Altiris report?

    Posted Mar 09, 2017 06:27 AM

    Network23,

    Thansk for the thought, but as you can see in my question, I have executed the Get Status task on the machine and I want to read the results of the Get Service Status task in the CMDB and not use a Custom Inventory Task, thanks.



  • 5.  RE: How do I get the status of a Windows Service in an Altiris report?

    Posted Mar 09, 2017 06:29 AM

    Stephan,

    Thanks - that topv.value 'Instance Output Text' field illuded me!

    Kindest regards,

     

    QuietLeni