I have a perl script which runs on a different host, I have to implement a proactive monitoring of this script, so that if at anytime the script fails to run I need to capture the error msg. in a text file and email it to the admin.
I am executing the script as
`rsh $host /path/to/script/script.pl argument1 argument2`
I already have the email script which takes arguments and sends out the email.
Appreciate if someone can point me in the right direction on how to capture the errors when the script fails.