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

Using regular expression on whole file

Votes:

0

Hello,

I'm using a filesensor to detect if the last line of a file containss OK Or NOT_OK. This file is on append mode, added by a Windows Schedule Task.

The file is like this :

launch-1;2018-01-01;OK
launch-2;2018-01-02;NOT_OK

My Regex is .*;NOT_OK$

The alarm is triggered but when a new line is added, the alarm is not canceled.

I think the Regex is executed on each line of the file, and not on the whole content, even if i check "always transmis the whole file" in sensor options.

How can I do that ?

alarm script sensor

Created on Aug 8, 2019 8:08:15 AM

Last change on Aug 8, 2019 10:58:01 AM by  Sebastian Kniege [Paessler Support]



1 Reply

Votes:

0

Hi elo,

Thank you very much for your contact.

The RegEx appears to be well formatted. Do I understand you correctly, that this is a contentiously growing file? If so, I would also expect the sensor to change its state based on the findings of the last line. For instance, if the last line does not contain OK or NOT_OK, the sensor should behave differently than when the string is found.

Does this sum up your situation?

Best regards,
Sebastian

Created on Aug 9, 2019 10:30:47 AM by  Sebastian Kniege [Paessler Support]




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.