plugin check_logfiles

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
rambertnala
Posts: 70
Joined: Fri Feb 26, 2016 7:15 am

plugin check_logfiles

Post 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
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: plugin check_logfiles

Post by kg2857 »

/<path>/check_logfiles -h
rambertnala
Posts: 70
Joined: Fri Feb 26, 2016 7:15 am

Re: plugin check_logfiles

Post 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
rambertnala
Posts: 70
Joined: Fri Feb 26, 2016 7:15 am

Re: plugin check_logfiles

Post 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
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: plugin check_logfiles

Post by kg2857 »

Maybe try .* or \.*
rambertnala
Posts: 70
Joined: Fri Feb 26, 2016 7:15 am

Re: plugin check_logfiles

Post by rambertnala »

Yes !!!!

It is necesary .*

Thanks
Post Reply