New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Using regular expression on whole file

Votes:

0

Your Vote:

Up

Down

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 by  elo (0) 1

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



1 Reply

Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.