Client Management Suite

 View Only
  • 1.  Verification of agent health

    Posted Aug 10, 2016 03:33 PM

    I would like to build a script to do a few checks on the local system.

    Based on the result create exit codes, and then verify as conditions for the further tasks in the job.

    What are some things i can check for on the local system?

    Thank you,



  • 2.  RE: Verification of agent health

    Posted Aug 11, 2016 10:28 AM

    Could you give a bit more detail as to what you are trying to achieve? What problem are yout trying to solve?



  • 3.  RE: Verification of agent health

    Posted Aug 11, 2016 03:22 PM

    We are doing a frim wide deployment. Started with a pilot and i see some clients are failing to even start. 

    I would like to check client helth first before starting a job.

    For example 

    If healty exit with 0 and start the job

    If 1 exit with error.



  • 4.  RE: Verification of agent health

    Posted Aug 11, 2016 06:29 PM

    So you could use a Job with Conditions and Windows Command (DOS) scripts.

    sc query servicename|find "STARTED"

    That should return 0 if started and 1 if not.

    That sort of thing.



  • 5.  RE: Verification of agent health

    Posted Aug 12, 2016 09:34 AM

    Thank you. I was looking for few things i can check for.

    What else i can look for besides runnign service?

    Thank you,



  • 6.  RE: Verification of agent health

    Posted Aug 12, 2016 04:48 PM

    Is it the health of the Symantec Management Agent you're worried about? If so there's reports you can run that show PCs that haven;t returned basic inventory for so many days, that sort of thing.

    You can also look at the Targets of the plug-in installs to see if there's any not getting installed, I put a daily schedule.on plug-in installs so any that fail once can try again. I look at the Software Execution report to see if any installs (plug-ins or general software) are failig repeatedly.

    If it's the state of your application before it's upgraded you want to look at we'll need to know a bit more about it.



  • 7.  RE: Verification of agent health

    Posted Aug 15, 2016 11:59 AM

    Are you using Symantec Endpoint Protection for antivirus?  If you are, you can use the Host Integrity feature of SEP to check a few things regarding the agent.  We use this feature in SEP to check if the agent is started, if the agent is the correct version number, and then if anything is off, we reinstall the agent using an externally available address for the CEM agent installer download.  Just an idea if you have SEP.



  • 8.  RE: Verification of agent health

    Posted Aug 16, 2016 06:05 PM

    I'm a little confused on what exactly you are trying to check for the health status on, if it is the SMP Agent, here is a Powershell funciton I wrote to get the health status. I have other functions that then take various remediation steps based on the output here. I set my remediation script to run on each system in the domain via scheduled task I setup in Group Policy.

     

    function Get-AltirisAgentHealth
    {
    #How many days we can accept policy to not have been updated.
    $Cutoff = (Get-Date).AddDays(-20)
    #Exit variables.
    $Healthy = 'Healthy'
    $NOGuid = 'NoGUID'
    $OldPolicy = 'OldPolicy'
    $NoAgent = 'NoAgent'
    $NoPolicy = 'NoPolicy'
    $BrokenCOM = 'BrokenCOM'

    #Service Check
    $AltirisService = Get-Service -Name AeXNSClient -ErrorAction SilentlyContinue

    #Logging variables
    $Timestamp = Get-Date -Format yyyy-MM-dd-hh-mm
    $hostname = HOSTNAME.EXE
    $ErrorNetworkLog = 'FileSystem::\\SomeServer\Logs\Errors\' + $hostname + '-' + $Timestamp + 'GetAltirisAgentHealthError' + '.txt'

    try {  
      
      if ($AltirisService)
      {   
        #Altiris COM object. Moved down here to prevent ugly errors if service doesn't exist.
        $AltirisAgent = New-Object -ComObject Altiris.AexNSClient
        if ($AltirisAgent.MachineGuid)
        {
          #GUID exists. Communication has happened at some point, let's see how long ago.
          $LastPolicyString = $AltirisAgent.LastPolicyUpdate

          if ($LastPolicyString)
            {
             #Converting string to object date time. Shouldn't throw an exception since we verified string exists.
             $LastPolicyObject = [datetime]"$LastPolicyString" 
             if ($LastPolicyObject -lt $Cutoff)
                {
                  #Agent has not received updated policy recently.
                  $OldPolicy
                }
             
             else
                {
                  #Agent health appears good.
                  $Healthy
                }
                    
            }
          
          else
            {
              #No policy ever pulled down.
              $NoPolicy
            }    
        }
        
        else
          {
            #No GUID means no communication.
            $NOGuid
          }
      }
      
      else
      {
        #Agent not found.
        $NoAgent
      }
     }

    Catch
    {
      $ErrorMessage = $_.Exception.Message
      "$hostname unable to Get Altiris Agent Health at $Timestamp due to $ErrorMessage" | Out-File -FilePath $ErrorNetworkLog
      $BrokenCOM
    }
    }