execute command upon failure of a windows service / failover cluster resource
===

not sure if this is for Superuser or here - i am running on Windows Server Enterprise (2007) SP2. is there no way to execute something (custom program / script) if a specific Windows service, which is configured as a Failover Cluster resource, fails (and the failure is detected by the system, so the service is restarted in configurable manner)?

i understand that since there is an ability to detect failures / report them as events and to restart the service automatically, there could be a way to call custom (e.g. cleanup) code in these cases.

i know that one could write a program that could poll constantly if a particular service is running, and do stuff when it fails. but i thought that maybe i could post a question here in order to not reinvent the wheel. 
thank you.