Event handler help

If this is a dupe PLEASE point me to the thread that will explain this.

I am attempting to write a script that will restart a service on a REMOTE host when Nagios notices it fails. I have only been able to find help on restarting a local service.

Here is the scenario for clarification:

Nagios runs check_ssh on HOST 1
HOST 1 fails check_ssh 3 times
Nagios runs script to restart ssh on HOST 1

How do I do this? I am running myself in circles. PLEASE HELP!