How to restart an agent using script.

Discussion created by Shane_Meek_183 on Jan 21, 2015
Latest reply on Jan 21, 2015 by eric.felker
Prereq: You must have agents in Automic "Linked" to Service Manager.

In the process tab of a job, enter the following:

!define the agent name 
:set &agent_name# = 'agent to restart' 
!stop the agent 
:set &act# = modify_system('terminate', &agent_name#) 
:wait 15 
!start the agent 
:set &ACT# = modify_system('startup', &agent_name#) 

You can find more information on modify_system here.