It is possible to execute an object when an agent stops, starts or crashes using EXECUTE_ON_START, EXECUTE_ON_END and EXECUTE_ON_LOST. This can be any executable object in any client other than client 0000.
1. Login to client 0000
2. Edit UC_HOSTCHAR_DEFAULT (or the alternative UC_HOSTCHAR* object that is used by the agent)
3. Define the object that will be executed under column 'Value 1'
In the example below the object 'CALL.MAIL.HTML.EXECUTE' is executed when an agent is started, stopped or lost (crash)
Please see the documentation link below for more details.