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

monitoring a file?



Is there a way to monitor a file for a changing numerical value? I have a metric script that writes its output as a numerical value to a text file, and I'd like to be able to draw that output value into PTRG as a sensor value and raise a warning if it's above/below a specific numerical value. The only content of the text file would be a number that would get updated every 30 minutes or so.

Thanks! Scott

changing-value file-monitoring numerical-value

Created on Dec 22, 2010 4:08:59 PM

4 Replies



Dear Scott,

this should be possible using the Custom Sensor LogfileReader from our PRTG User Gerard Feijth.

Best Regards.

Created on Dec 22, 2010 4:38:04 PM by  Torsten Lindner [Paessler Support]



That does allow monitoring of a file, but only seems to be able to indicate whether the file has changed or not. I need to be able to actually display the contents of the file as the sensor output, and throw a warning/error if the number is less than 100. I am able to get the output of that custom sensor to show the value I want as "last message", but "last result" appears to be the only output that's usable, and that's only a 0/1/2 output depending on the change status of the file contents.


Created on Dec 22, 2010 7:34:14 PM



It says "This Custom Sensor returns whether a specified string occurs in a (log) file", so an actual content is performed. However this will not enable the usage of the limits then in PRTG, as it's a string.

Created on Dec 22, 2010 7:53:08 PM by  Torsten Lindner [Paessler Support]



Well, this seems simple enough for a small batch file. Create a file called value.bat in the \Custom Sensor\EXE folder of your PRTG installation and paste the following 3 lines:

@echo off
type %1%
echo :this is my value

Create a new sensor and select the value.bat file. As commandline parameter you will need to supply the filename that holds the value you want to use.

Note: the file that holds the value must not contain any linefeeds.

Regards, Gerard

Created on Dec 23, 2010 4:48:58 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.