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

How can I alarm with PRTG if a certain file is existing (otherwise sensor should be green)?



I want to check if a certain file exists, and then have a alarm. If the file doesn't exist PRTG should show a green status icon of the sensor. Is that somehow possible?

custom-sensor file-sensor prtg

Created on Jul 20, 2010 1:13:18 PM by  Torsten Lindner [Paessler Support]

2 Replies

Accepted Answer



This is only possible with a custom sensor, for example the following vbscript:

DEMO - Alarm if file exists.vbs

Dim file, WshFso

Set WshFso = CreateObject("Scripting.FileSystemObject")
file = "c:\test.txt"

If (WshFso.FileExists(file)) then
	WScript.Echo "2:File does exist"
	WScript.Echo "0:File does not exist"	
End If

Please be aware that this script can only be executed by PRTG on a probe. Thus it is necessary to have the file available for PRTG from a probe machine. In this scenario, please also bear in mind the context under which PRTGs Probe service is running, it may not have the same access rights to certain folders/files as a normal (admin) user.

Best Regards.

See Also

Manual section Custom Sensors

Created on Jul 20, 2010 1:16:38 PM by  Torsten Lindner [Paessler Support]

Last change on Jul 20, 2010 1:37:37 PM by  Daniel Zobel [Product Manager]



Custom Sensor available

This can also be achieved with Custom Sensor NetworkFileCount

NetworkFileCount -u=username -p=password|passhash -f=\\myserver\myshare [-s=*.exe -sub]

Supply the credentials (username and password) of an account that has read acces to the file location. Set the "-s=" parameter to match the exact name of the file you want to check.

The sensor returns the number of files matching the "-s=" filter, so in this case if the specified file exists it returns 1 and if the file does not exist it returns 0.

The Custom Sensor can be downloaded from this page.

Created on Jul 23, 2010 3:28:59 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.