Click here to get back home

monitor unix file for string

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
monitor unix file for string jamesjesse68 02-28-2008
Posted by jamesjesse68 on February 28, 2008, 8:20 am
Please log in for more thread options
Hello,

I have a requirement to monitor a log file in unix using perl 5.8.
Needed is detection of "error" in a line appended to the file.
Also need to detect if "complete" is not found after, say, 5 hours
after invocation.

I expect there is a hard way and an easy way to do this - could some
kind person advise me?
Pointers to Fine Perldocs welcome!

TIA

JJ


Posted by Josef Moellers on February 28, 2008, 8:23 am
Please log in for more thread options
jamesjesse68@yahoo.com wrote:
> Hello,
>
> I have a requirement to monitor a log file in unix using perl 5.8.
> Needed is detection of "error" in a line appended to the file.
> Also need to detect if "complete" is not found after, say, 5 hours
> after invocation.
>
> I expect there is a hard way and an easy way to do this - could some
> kind person advise me?
> Pointers to Fine Perldocs welcome!


perldoc -q tail

How do I do a "tail -f" in perl?

HTH,

Josef
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html

Posted by Peter Makholm on February 28, 2008, 8:24 am
Please log in for more thread options
jamesjesse68@yahoo.com writes:

> Hello,
>
> I have a requirement to monitor a log file in unix using perl 5.8.
> Needed is detection of "error" in a line appended to the file.

'perldoc -q tail'

> Also need to detect if "complete" is not found after, say, 5 hours
> after invocation.

'perldoc -f alarm'

might be two useful pointers.

//Makholm

Similar ThreadsPosted
Perl/unix script to convert a fixed width file to a tab delimited file September 29, 2007, 9:35 am
log monitor September 14, 2006, 10:04 am
How to monitor changes in a directory November 9, 2006, 5:13 pm
monitor for sleeping processes December 23, 2004, 10:03 am
Can a perl script monitor another? May 17, 2005, 2:31 pm
Writing a system log monitor March 27, 2007, 5:45 pm
Perl to monitor server stats October 13, 2004, 11:44 am
How to monitor a process in system call October 22, 2004, 9:46 am
Monitor a Serial Port (Win2k) December 1, 2004, 2:44 am
Re: Can I monitor the execution of a perl script September 2, 2006, 8:59 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap