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

Check file size in folder alarm below x value

Votes:

0

ls,

I am a new in PRTG. Now I need the following.

I have a folder monitoring where various files are located in and which are then uploaded to an FTP server.

I want to know immediately when a file in that folder is below 2kb. In that folder wil be different files with different names.

Now my question is I have the sensor and settings for use here.

alarm file folder size value

Created on Nov 20, 2014 10:23:13 PM



1 Reply

Accepted Answer

Votes:

4

Hi,

This can be done with a simple batch sensor folowing the script below:

@echo off
set /a counter=0
for /F "tokens=3" %%a in ('dir c:\temp /-c') do (
  if %%a LSS 2048 set /a counter=counter+1
)
echo %counter%:Found %counter% file(s) with size less than 2 Kb.

The example above will return the number of files in 'c:\temp' having a filesize less than 2 Kb. Using limits, you can set the sensor to a waring or error state.

Created on Nov 21, 2014 1:32:53 PM




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.