Restart Server when a service spikes

After either x amount of time or x amount of hits to the site, the Java service, which is part of FileMaker Server Web Publishing, will spike and eat up over 100% of the processor utilization. We do have all of the necessary patches from software update and FileMaker, Inc.

We would like to setup a script that restarts the java service OR restart the FileMaker Web Publishing service.

We are looking to reboot either of these services if they run at >100% for a 2 minute period.

how can this be done?

HI guys… does anyone have a solution / script for this? Thanks for your help!