Intel AMT Features > Agent Presence > Use Cases > Get an Agent Watchdog's Actions
CollapseAll image

Get an Agent Watchdog's Actions

The following steps describe how to get the actions of an agent watchdog.

1.  Recover the EPR of the desired agent, using the AMT_AgentPresenceWatchdog.DeviceID as a key.

2.  Invoke CIM_ConcreteDependency.Enumerate.

3.  Examine the list returned by the enumerate and search for the instances where:

   The type of CIM_ConcreteDependency.Antecedent property is the EPR of the instance of AMT_AgentPresenceWatchdog from step 1.

   The type of CIM_ConcreteDependency.Dependent property is AMT_StateTransitionCondition

Perform the following steps for each of the instances you find.

4.  Invoke AMT_StateTransitionCondition.Get using the EPR stored in the CIM_ConcreteDependency.Dependent property. The instance holds the transition details of the current action.

Perform the following steps to get the action details associated with the condition.

5.  Invoke CIM_ConcreteDependency.Enumerate , where the Antecedent property equals the EPR of the instance of AMT_StateTransitionCondition from step 4 and the Dependent property is AMT_AgentPresenceWatchdogAction.

Perform the following steps for each of the instances you find.

6.  Invoke AMT_AgentPresenceWatchdogAction.Get using the EPR stored in the Dependent property. The instance holds the action details: EventOnTransition and ActionSD.

7.  Invoke AMT_AgentPresenceWatchdogAction.GetActionEac to retrieve the ActionEac.

Click here for a snippet demonstrating this step

See the General Info Get Core Version use case for the GetCoreVersion function.

You can execute this snippet by inserting it into the execution template found here.

  

$deviceID =# The ID of the agent watchdog in Base64 format, provided by the caller when the AMT_AgentPresenceWatchdog was created.

# Create a reference to AMT_AgentPresenceWatchdog instance

$agentPresenceWatchdogRef =$wsmanConnectionObject.NewReference("SELECT * FROM AMT_AgentPresenceWatchdog WHERE DeviceID='" +$deviceID +"'")

$concreteDependencyRef =$wsmanConnectionObject.NewReference("CIM_ConcreteDependency")

$concreteDependencyRef.AddSelector("Antecedent",$agentPresenceWatchdogRef)

# Traverse to the CIM_ConcreteDependency instances that are connected to the AMT_AgentPresenceWatchdog instance.

foreach($concreteDependencyItem in$concreteDependencyRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter",$null))

{

    # For each instance, check if it is associated to the AMT_StateTransitionCondition instance.

if($concreteDependencyItem.Object.GetProperty("Dependent").IsA("AMT_StateTransitionCondition"))

    {   

          # AMT_StateTransitionCondition specifies the condition that causes an action to occur. 

          $stateTransitionConditionRef =$concreteDependencyItem.Object.GetProperty("Dependent").Ref

          $stateTransitionConditionInstance =$stateTransitionConditionRef.Get() 

          $oldState =$stateTransitionConditionInstance.GetProperty("OldState")

          $newState =$stateTransitionConditionInstance.GetProperty("NewState")

         

          # AMT_AgentPresenceWatchdogAction represents the action that occurs when the transition condition is true.

          $concreteDependencyRef =$wsmanConnectionObject.NewReference("CIM_ConcreteDependency")

          $concreteDependencyRef.AddSelector("Antecedent",$stateTransitionConditionRef)

          # Traverse to the CIM_ConcreteDependency instances that are connected to the AMT_StateTransitionCondition instance.

          foreach($concreteDependencyItem in$concreteDependencyRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter",$null))

          {

                # For each instance, check if it is associated to the AMT_AgentPresenceWatchdogAction instance.

          if($concreteDependencyItem.Object.GetProperty("Dependent").IsA("AMT_AgentPresenceWatchdogAction"))

                {

                      # Get the AMT_AgentPresenceWatchdogAction object using its EPR.

                      $agentPresenceWatchdogActionRef =$concreteDependencyItem.Object.GetProperty("Dependent").Ref

                      $agentPresenceWatchdogActionInstance =$agentPresenceWatchdogActionRef.Get()

                      $eventOnTransition =$agentPresenceWatchdogActionInstance.GetProperty("EventOnTransition")

                      $actionSd =$agentPresenceWatchdogActionInstance.GetProperty("ActionSd")

                      $fwVersion = GetCoreVersion

                      if($fwVersion.ToString() -ge "4.0")

                      {

                            $inputObject =$agentPresenceWatchdogActionRef.CreateMethodInput("GetActionEac")

                            $outputObject =$agentPresenceWatchdogActionRef.InvokeMethod($inputObject)

                            $returnValue =$outputObject.GetProperty("ReturnValue")

                            if($returnValue -like "0")

                            {

                                  $actionEac =$outputObject.GetProperty("ActionEac")

                            }

                      }

                }

          }

    }    

}

 

 

 

 Note:

The ActionEAC parameter is supported only by Intel AMT Release 4.0 and later.

 

Instance Diagram

Classes Used in This Flow

SDK Sample

If there is a sample demonstrating this flow, it is included in the SDK installation file. See SDK Installation Layout for details.

 

See Also:

   Agent States

   Agent Watchdog Timers and Actions

   Limitations on the Number of Actions and Agents

Copyright © 2006-2022, Intel Corporation. All rights reserved.