What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

We would like to know how long a file takes to copy

Votes:

0

we have a remote probe at a site connected to a site to site vpn. Even though all other sensors are showing normal, the users are complaining that it is taking a long time to copy the data. We would like to see how long it takes for a 1 mb file at the main site takes to copy to the remote probe across the VPN over SMB, and have the threasholds set to 5 seconds for warning and 10 seconds for alarm.

file sensor smb speed

Created on Jul 11, 2011 2:52:39 PM



Best Answer

Accepted Answer

Votes:

0

You can use this as a batch file sensor:

@echo off
 
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Second /Format:table ^| findstr /r "."') DO (
 set Milisecond=%time:~9,2% 
 set Day=%%A
 set Hour=%%B
 set Minute=%%C
 set Second=%%D
)
set /a Start=%Day%*8640000+%Hour%*360000+%Minute%*6000+%Second%*100+%Milisecond%
 
:: put your copy command here
:: and delete the ping command (only used for testing)
ping www.paessler.com > nul
 
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Second /Format:table ^| findstr /r "."') DO (
 set Milisecond=%time:~9,2% 
 set Day=%%A
 set Hour=%%B
 set Minute=%%C
 set Second=%%D
)

set /a End=%Day%*8640000+%Hour%*360000+%Minute%*6000+%Second%*100+%Milisecond%
set /a Diff=%End%-%Start%

echo %Diff%:ok

This will return the number of milliseconds it took for your copy command to finish.

Note: Calculating the end time also takes time, so the calculation is not 100% accurate. You might want to consider doing a "dry run" without a copy command and subtract the outcome (approximately 10 to 15 msec) from the result.

set /a Diff=%End%-%Start%-10

Created on Jul 12, 2011 12:39:04 PM

Last change on Jul 12, 2011 1:11:25 PM by  Patrick Hutter [Paessler Support] (7,225) 3 3



6 Replies

Votes:

0

Dear Cliff,

you could try the solution from the following article Monitoring the Available Bandwidth (Part 2)

best regards.

Created on Jul 11, 2011 3:13:43 PM by  Torsten Lindner [Paessler Support]



Votes:

0

THe problem is that option is only available on HTTP. The problem is only reported over SMB. Additionally, the issue is quite intermitent, hence the desire to have it run through PRTG, and not just a set of scheduled tasks where we would have to monitor a seperate text file. I could do a reoccuring task in Windows running a batch script that would note the date time, copy the file, and then note the date time, and we could take the difference. Bandwidth is not an issue, as they are using Exchange over the VPN, and downloading much large files than they are tring to open with the VPN. Additionally, if I take the images that they are using, and have them open them up throuh an IIS site on the same server, they work fine. I have not seen the issue, but I have reports of a 110 kb file taking 140 seconds to open, but if they use the IIS site at the same time, it is near instant. When I test it from the remote probe, I have 145 ms time to open the file. We need to capture the incident when it happens, and react to it, which is why we want PRTG to help with that.

Created on Jul 11, 2011 3:22:56 PM



Votes:

0

If you want to check the speed of SMB-operations (copy), then it's necessary to do that with a self-written script which then runs as a sensor in PRTG.

Created on Jul 11, 2011 4:21:12 PM by  Torsten Lindner [Paessler Support]



Votes:

0

And that is the root of the question. I can write a batch file that will do the copy operation. How do I get the script to run and collect the duration of the copy function to display as a channel on the sensor

Created on Jul 11, 2011 4:24:06 PM



Votes:

0

Well, that might require for example VBScript using its Timer Function, and the script to stop the time itself.

Created on Jul 11, 2011 4:38:25 PM by  Torsten Lindner [Paessler Support]

Last change on Jul 11, 2011 4:39:02 PM by  Torsten Lindner [Paessler Support]



Accepted Answer

Votes:

0

You can use this as a batch file sensor:

@echo off
 
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Second /Format:table ^| findstr /r "."') DO (
 set Milisecond=%time:~9,2% 
 set Day=%%A
 set Hour=%%B
 set Minute=%%C
 set Second=%%D
)
set /a Start=%Day%*8640000+%Hour%*360000+%Minute%*6000+%Second%*100+%Milisecond%
 
:: put your copy command here
:: and delete the ping command (only used for testing)
ping www.paessler.com > nul
 
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Second /Format:table ^| findstr /r "."') DO (
 set Milisecond=%time:~9,2% 
 set Day=%%A
 set Hour=%%B
 set Minute=%%C
 set Second=%%D
)

set /a End=%Day%*8640000+%Hour%*360000+%Minute%*6000+%Second%*100+%Milisecond%
set /a Diff=%End%-%Start%

echo %Diff%:ok

This will return the number of milliseconds it took for your copy command to finish.

Note: Calculating the end time also takes time, so the calculation is not 100% accurate. You might want to consider doing a "dry run" without a copy command and subtract the outcome (approximately 10 to 15 msec) from the result.

set /a Diff=%End%-%Start%-10

Created on Jul 12, 2011 12:39:04 PM

Last change on Jul 12, 2011 1:11:25 PM by  Patrick Hutter [Paessler Support] (7,225) 3 3




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.