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
plugin check_logfiles
Re: plugin check_logfiles
/<path>/check_logfiles -h
-
rambertnala
- Posts: 70
- Joined: Fri Feb 26, 2016 7:15 am
Re: plugin check_logfiles
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
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
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
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
Maybe try .* or \.*
-
rambertnala
- Posts: 70
- Joined: Fri Feb 26, 2016 7:15 am
Re: plugin check_logfiles
Yes !!!!
It is necesary .*
Thanks
It is necesary .*
Thanks