When the agent stops or starts it should generate an Event and send it to Event Receiver. Event Receiver URL is specified in the agent config. The stop event should probably be generated in the ShutdownHook.
A note regarding event receiver URL - it doesn't have to be present and that is a valid case. Agent should in such cases just quietly skip sending any events.
When the agent stops or starts it should generate an Event and send it to Event Receiver. Event Receiver URL is specified in the agent config. The stop event should probably be generated in the ShutdownHook.