A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » The Basics
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Monitoring the growth of a file



 
 
Thread Tools Display Modes
  #1  
Old December 23rd 09, 12:23 PM posted to microsoft.public.windowsxp.basics
deleting specific extensions
external usenet poster
 
Posts: 2
Default Monitoring the growth of a file

Hello guys!
I would like to know if it is possible to monitor the growth of a file. For
example, I have a file that each hour it is modified and then I have to know
if this file is growing because if it is not, I have a problem.
I was trying to configure it on Operations Manager but it is not possible.
This script would be run each hour and if the file doesn´t grows send me a
e-mail.
Anyone can help me?
Thanks.

Ricardo Ito
Ads
  #2  
Old December 24th 09, 09:18 AM posted to microsoft.public.windowsxp.basics
Graham
external usenet poster
 
Posts: 52
Default Monitoring the growth of a file

Hi Recardo
"deleting specific extensions"
. com wrote in message
...
Hello guys!
I would like to know if it is possible to monitor the growth of a file.
For
example, I have a file that each hour it is modified and then I have to
know
if this file is growing because if it is not, I have a problem.
I was trying to configure it on Operations Manager but it is not possible.
This script would be run each hour and if the file doesn´t grows send me a
e-mail.
Anyone can help me?
Thanks.

Ricardo Ito


I would suggest you use the GetFileSize function in the Windows API:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Or perhaps better use the last modification time for the file using the
GetFileTime function:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Graham.

  #3  
Old December 24th 09, 09:18 AM posted to microsoft.public.windowsxp.basics
Graham
external usenet poster
 
Posts: 52
Default Monitoring the growth of a file

Hi Recardo
"deleting specific extensions"
. com wrote in message
...
Hello guys!
I would like to know if it is possible to monitor the growth of a file.
For
example, I have a file that each hour it is modified and then I have to
know
if this file is growing because if it is not, I have a problem.
I was trying to configure it on Operations Manager but it is not possible.
This script would be run each hour and if the file doesn´t grows send me a
e-mail.
Anyone can help me?
Thanks.

Ricardo Ito


I would suggest you use the GetFileSize function in the Windows API:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Or perhaps better use the last modification time for the file using the
GetFileTime function:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Graham.

  #4  
Old December 24th 09, 11:35 AM posted to microsoft.public.windowsxp.basics
Ricardo Ito
external usenet poster
 
Posts: 4
Default Monitoring the growth of a file

I found some scripts and merged as a result:

--
strComputer = "computername"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceModificationEvent WITHIN 10 WHERE " _
& "TargetInstance ISA 'CIM_DataFile' and " _
& "TargetInstance.Name='c:\\temp\\text.txt'")

Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "
objEmail.To = "
objEmail.Subject = "Something"
objEmail.Textbody = "The file text.txt is growing!!!"
objEmail.Send
Loop
--

"Graham" wrote:

Hi Recardo
"deleting specific extensions"
. com wrote in message
...
Hello guys!
I would like to know if it is possible to monitor the growth of a file.
For
example, I have a file that each hour it is modified and then I have to
know
if this file is growing because if it is not, I have a problem.
I was trying to configure it on Operations Manager but it is not possible.
This script would be run each hour and if the file doesn´t grows send me a
e-mail.
Anyone can help me?
Thanks.

Ricardo Ito


I would suggest you use the GetFileSize function in the Windows API:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Or perhaps better use the last modification time for the file using the
GetFileTime function:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Graham.

.

  #5  
Old December 24th 09, 11:35 AM posted to microsoft.public.windowsxp.basics
Ricardo Ito
external usenet poster
 
Posts: 4
Default Monitoring the growth of a file

I found some scripts and merged as a result:

--
strComputer = "computername"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceModificationEvent WITHIN 10 WHERE " _
& "TargetInstance ISA 'CIM_DataFile' and " _
& "TargetInstance.Name='c:\\temp\\text.txt'")

Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "
objEmail.To = "
objEmail.Subject = "Something"
objEmail.Textbody = "The file text.txt is growing!!!"
objEmail.Send
Loop
--

"Graham" wrote:

Hi Recardo
"deleting specific extensions"
. com wrote in message
...
Hello guys!
I would like to know if it is possible to monitor the growth of a file.
For
example, I have a file that each hour it is modified and then I have to
know
if this file is growing because if it is not, I have a problem.
I was trying to configure it on Operations Manager but it is not possible.
This script would be run each hour and if the file doesn´t grows send me a
e-mail.
Anyone can help me?
Thanks.

Ricardo Ito


I would suggest you use the GetFileSize function in the Windows API:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Or perhaps better use the last modification time for the file using the
GetFileTime function:

http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Graham.

.

  #6  
Old December 24th 09, 07:48 PM posted to microsoft.public.windowsxp.basics
Twayne[_3_]
external usenet poster
 
Posts: 1,073
Default Monitoring the growth of a file

In ,
deleting specific extensions
. com typed:
Hello guys!
I would like to know if it is possible to monitor the growth of a
file. For example, I have a file that each hour it is modified and
then I have to know if this file is growing because if it is not, I
have a problem.
I was trying to configure it on Operations Manager but it is not
possible. This script would be run each hour and if the file doesn´t
grows send me a e-mail.
Anyone can help me?
Thanks.

Ricardo Ito


You could schedule a .bat to run hourly and pipe the output of a DIR command
to a file. ' ' is the append symbols so the old data isn't overwritten.
Quckest and easiest I know of. And if you know how to use filters in the
CLI, you could log just the filesize you want instead of all of the dir
command.
Is it a file you can move to a different folder?

Twayne
--
We've already reached
tomorrow's yesterday
but we're still far away from
yesterday's tomorrow.

  #7  
Old December 24th 09, 07:48 PM posted to microsoft.public.windowsxp.basics
Twayne[_3_]
external usenet poster
 
Posts: 1,073
Default Monitoring the growth of a file

In ,
deleting specific extensions
. com typed:
Hello guys!
I would like to know if it is possible to monitor the growth of a
file. For example, I have a file that each hour it is modified and
then I have to know if this file is growing because if it is not, I
have a problem.
I was trying to configure it on Operations Manager but it is not
possible. This script would be run each hour and if the file doesn´t
grows send me a e-mail.
Anyone can help me?
Thanks.

Ricardo Ito


You could schedule a .bat to run hourly and pipe the output of a DIR command
to a file. ' ' is the append symbols so the old data isn't overwritten.
Quckest and easiest I know of. And if you know how to use filters in the
CLI, you could log just the filesize you want instead of all of the dir
command.
Is it a file you can move to a different folder?

Twayne
--
We've already reached
tomorrow's yesterday
but we're still far away from
yesterday's tomorrow.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 10:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.