10 pts.
 Perl script to monitor application start and stop events in logfile
Hello, I am looking for a perl script for Unix that would monitor for a start and stop line in an applciaiton logfile that contains the date/time of stat and stop. It needs to be able to calculate the date/time from start of applciation for 30 minutes and if no stop is logged to logfile within 30 minutes to send an alert or email notification. Not a perl scriptor, but Perl is needed for my environment. Any help appreciated. Thanks.

Software/Hardware used:
ASKED: April 3, 2008  1:38 PM
UPDATED: June 25, 2008  5:30 PM

Answer Wiki:
I would recommend <a href="http://simple-evcorr.sourceforge.net/">SEC</a>. You can use SEC to monitor the logfile in real time and have it keep track of what you want it to. You would want a <b>PairWithWindow</b> type rule. Something like this: <pre> type=PairWithWindow ptype=RegExp pattern=MyApplication started desc=MyApplication started action=logonly; pipe '$0' /bin/mailx -s 'MyApplication hasn't stopped in 30 minutes' somebody@mydom.com ptype2=RegExp pattern2=MyApplication stopped desc2=MyApplication stopped action2=none window=18001 </pre> That rule will send you an email if the app stop isn't noticed 30 mins after the app start. You would launch sec.pl with the <pre>-input=/path/to/logfile </pre>option for it to follow a certain log.
Last Wiki Answer Submitted:  June 25, 2008  5:30 pm  by  MarkK   645 pts.
All Answer Wiki Contributors:  MarkK   645 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _