I think both the comments above are great solutions to your quandary, along with being very similiar.

The Nagios software will conduct a number actions for you, however you specify. It will watch for normal activity, log in specified events and notify when necessary. You can also schedule outages along with other things relative to a centralized monitoring system. The one pretty big downfall is that it is not the easiest software to customize, particularly when you are looking for something used for simple scripts.

The second solution, in your case, is most likely ideal for you and is really a VERY simplified version of Nagios. In your case, along with the wonders of Perl, there are a number of ways to take care of this. I'll add a simple example that might hopefully spark your imagination.

First, hopefully you wont have to be weary of every line of code in your scripts. Generally speaking, there are a limited numbrer of things that will unexpectedly cause your script to fail. In these circumstances, you can 'catch' these by using the eval{} block, followed by a test for $@ special variable.

For example:
eval { die 'Ack!'; }; print "ERROR: $@\n"; exit; __END__
Will output: ERROR: Ack! Using this, you can:
eval { # Something that can die ... }; Your::CustomMod::launch_error( $@ ) if ( $@ );
This way, you can programatically avoid areas where you want a die, warn, etc. to happen, yet catch the unexpected. You can be sure you catch only what you want to catch.
Good Luck

In reply to Re: RFC: Module idea: Carp + controlled email by wazzuteke
in thread RFC: Module idea: Carp + controlled email by pileofrogs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.