Click to See Complete Forum and Search --> : log file/directory monitor - script? tools?


THY02K
August 29th, 2007, 12:14 AM
Hi I want to monitor a "DIRECTORY" if any log file is writing to it: "Error : xxx" - if located, a specified Exe can be triggered to execute.

Anyone suggest a tool with which this objective can be accomplished?

I also tried to accomplish the same by:


for /f "eol=; tokens=*" %%x in (C:\temp\*.log) do if "%%x" CONTAINS "error" LogMonAction.exe


Basically I tried to monitor all log files in C:\temp directory, if any log file created/updated since last night, execute "LogMonAction.exe" or another log file.

Problem with above script is, there's no such comparison operator "CONTAINS", and you cant do this on a DIRECTORY. And let aside the additional requirement - only files updated/created since last night.

Thansk

Reference:
(a) If statement: If statement (http://www.robvanderwoude.com/if.html)
(b) Textlog Monitor: Textlog Monitor (http://www.sharewareconnection.com/text-log-monitor.htm )

PeejAvery
August 29th, 2007, 08:03 AM
Well, you could easily write your own in Visual Basic or some other basic language. All you would need is a timer, count the files, check for specific file names.

THY02K
August 29th, 2007, 08:07 AM
dude, I been coding for more than five years now, from C, Java to dot-net of various flavours.

PeejAvery
August 29th, 2007, 09:02 AM
Okay?!!? :confused: