Intel AMT Features > Agent Presence > Use Cases > Set the Agent Watchdog Expiration Action
CollapseAll image

Set the Agent Watchdog Expiration Action

When an agent watchdog discovers its agent has entered the Expired state, it can be told to trigger a system reboot, thus giving the host machine the opportunity to fix whatever problem caused the agent to expire.

The following steps describe how to set an agent watchdog’s expiration action.

1.  Retrieve the instance of IPS_WatchDogAction using its InstanceID, “Intel (r) AMT Watch Dog Action”. This class contains the following properties:

a.   uint32 HeciWatchDogExpirationAction (required): Indicates the action to be taken if the OS watchdog expires. 0 indicates no action should be taken; 1 triggers a system reboot.

b.   uint32 AgentPresenceWatchDogExpirationAction (required): Indicates the action to be taken if an Agent Presence watchdog expires. 0 indicates no action should be taken; 1 triggers a system reboot.

c.   uint32 Timeout: Indicates the amount of time, in seconds, before the selected action(s) are taken. The value entered here applies to both OS and Agent Presence watchdogs. Valid values are between 0 (the action occurs immediately) and 86400 (the action takes place after 24 hours). The default value is 30 seconds.

d.   bool ReArmReset: Arms the reset. If false, the system reboot is disabled; if true, the system reboot is enabled. This value defaults to true when the firmware first comes up, and is set to false immediately after a reboot. This prevents the system from entering an endless reboot cycle in cases of a major error that the reboot does not repair.

 

Click here for a snippet demonstrating this step

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

  

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

{

  $watchDogActionRef =$wsmanConnectionObject.NewReference("SELECT * FROM IPS_WatchDogAction WHERE InstanceID='Intel (r) AMT Watch Dog Action'")

  $watchDogActionInstance =$watchDogActionRef.Get()

  $HeciWatchDogExpirationAction =$watchDogActionInstance.GetProperty("HeciWatchDogExpirationAction")

  $AgentPresenceWatchDogExpirationAction =$watchDogActionInstance.GetProperty("AgentPresenceWatchDogExpirationAction")

  $Timeout =$watchDogActionInstance.GetProperty("Timeout")

  $ReArmReset =$watchDogActionInstance.GetProperty("ReArmReset")

}

 

 

2.  Set each of the properties as desired.

3.  Invoke the Put method to apply the changes.

4.  For each watchdog, call the ApplyActionOnWatchDog function. This function takes two parameters:

a.   string AMT_AgentPresenceWatchdog (required): Indicates the name of the watchdog to which the expiration action should apply.

b.   bool ActionEnable: Activates (true) or deactivates (false) the expiration action for that particular watchdog.

 

Click here for a snippet demonstrating this step

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

  

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

{

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

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

  $watchDogActionRef =$wsmanConnectionObject.NewReference("SELECT * FROM IPS_WatchDogAction WHERE InstanceID='Intel (r) AMT Watch Dog Action'")

  $inputObject =$agentPresenceWatchdogRef.CreateMethodInput("ApplyActionOnWatchDog")

  $inputObject.SetProperty("AgentPresenceWatchDog", $agentPresenceWatchdogRef)

  $inputObject.SetProperty("ActionEnable","true")

  $outputObject =$agentPresenceWatchdogRef.InvokeMethod($inputObject)

 

}

 

 

 

 Note:

Only one set of expiration settings is maintained, and these settings apply to all watchdogs whose expiration action is activated. If the expiration settings are changed, the changes will apply to all watchdogs.

Classes Used in This Flow

See Also:

   Agent States

   Agent Watchdog Timers and Actions

   Get the Agent Watchdog Expiration Action

   Cancel a Pending Expiration-Triggered Reboot

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