Page 1 of 1

plugin check_logfiles

Posted: Fri Oct 31, 2025 4:23 am
by rambertnala
Hi friends

I am using plugin check_logfiles with file.cfg to look for some lines in a log file

My question is to know if there is any chance to use wildcards looking for a line ????

My case is to look for any that begin with Connect to URL followed by a lot of characters and last words of line are timed out

A line like this

Connect to URL xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx timed out

Thanks and regards

Re: plugin check_logfiles

Posted: Fri Oct 31, 2025 4:41 pm
by kg2857
/<path>/check_logfiles -h

Re: plugin check_logfiles

Posted: Mon Nov 03, 2025 6:30 am
by rambertnala
Hi...i have executed that command and i can see wilcards can be used

I have tried but in mi case I do not get CRITICAL

My line has a lot of chars. I have put on cfg

criticalpatterns => [ "Connect to url*timed out" ]

I have send to my test.log

echo "Connect to URL '12345' timed out" >> test.log

I have checked it and get OK.

Any idea????

Regards

Re: plugin check_logfiles

Posted: Mon Nov 03, 2025 7:43 am
by rambertnala
More data.
I have created a test-2025-11-03.log
I have inserted this line 11 times
Connect to URL 12345 timed out

I have checked with this command

check_logfiles --tag=test --logfile=/home/nagios/test-2025-11-03.log --criticalpattern 'Connect to URL * timed out'
OK - no errors or warnings|test_lines=11 test_warnings=0 test_criticals=0 test_unknowns=0

No Critical response

Re: plugin check_logfiles

Posted: Mon Nov 03, 2025 2:43 pm
by kg2857
Maybe try .* or \.*

Re: plugin check_logfiles

Posted: Thu Nov 06, 2025 4:17 am
by rambertnala
Yes !!!!

It is necesary .*

Thanks