I have written a script that logs into some storage arrays and sends out an e-mail which has a text file attachment containing the monitoring/health check outputs. At times, the script cannot completely run because it cannot access the storage arrays (when there are network issues) and when run from the command prompt in such situations, it will promptly "die". I am looking for ways to capture the "die" output in a mail so that my team would know something went wrong. As of now, either it sends the report or in case of network issues wherein it cannot access the storage arrays, the script just dies, and no mail is sent.
I am using MIME::Lite to get the e-mailing of the reports done and it works right. But is there a way to send the output of "die" to a file/e-mail?
|| Aeterna Est Perspectum Cognitio ||