0

I am not a programmer and just know enough carry on a half-way intelligent conversation. I am learning and going through a few self help programming guides though my primary strengths are networking and computer hardware.

That being said, I need help writing a script for a project I am working on at work. I need to monitor a log file that is constantly increasing in size and be notified (preferrably through email) if the file stops increasing in size. I thought maybe one way would be to monitor the timestamp attribute and if, for example, it is older than say 30 seconds or 1 minute to send the notification. Does this make sense or would there be a better way to do this?

What I was thinking was doing something like this:

check file stored -file c:\files\logs\monkeylog.log -timestamp if timestamp > 1 min then alert

Can someone please help me write this script?

Thank you!

ImpactGary
  • 11
  • 3
  • You could make a script saying I want this file and max size can be X. If the file ever grows bigger then that max size you will be notified because it will return a error – Tomm Oct 25 '17 at 13:44
  • Here's a very similar answer: https://stackoverflow.com/questions/1199645/how-can-i-check-the-size-of-a-file-in-a-windows-batch-script – Stefano Liboni Oct 25 '17 at 13:51
  • This is not the what I need- I need to monitor a file which should be growing in size every 5-10 seconds or so. I would like to be notified in some way (such as by email, etc) if the file stops 'growing'; that is if the file STOPS increasing in size. – ImpactGary Oct 25 '17 at 15:54
  • Is this possible, does not seem to be anything out there???? – ImpactGary Oct 26 '17 at 14:43

0 Answers0