The monitor script tests the liveliness of applications and resources. The best way to test it is to induce a failure, run the script, and check if this failure is detected by the script; then repeat the process for another failure.
Use this checklist for testing a monitor script:
Verify that the script detects failure of the application successfully.
Verify that the script always exits with a return value.
Verify that the script does not contain commands that can hang (such as using DNS for name resolution) or those that continue forever, such as ping.
Verify that the script completes before the time-out value specified in the configuration file.
Verify that the script's return codes are correct.
During testing, measure the time it takes for a script to complete and adjust the monitoring times in your script accordingly. To get a good estimate of the time required for the script to execute, run it under different system load conditions.