Check_logfile help

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
MattSmith46
Posts: 4
Joined: Tue Dec 19, 2017 4:38 pm

Check_logfile help

Post by MattSmith46 »

Hello,

I've installed and implement the check_logfile plugin, but I am having issue with the .cfg file. The logfile I want to monitor is MQIST.log and I would like it to alert when this error is generated in the log file "[ERR-04704] No inspection step found"
Here is my current .cfg file:

Code: Select all

@searches = (
{
tag => 'ERR-04704',
logfile => '/srv/oracle/adm/QSYS566P/logging/MQIST.log',
criticalpatterns => [ 'ERR-04704 No inspection step found']
},
);
Currently if I leave it configured this way I get multiple alerts from whenever the word error or anything in that string is generated in the log file. Also if if I try to put the [] around ERR-04704 I get an error. Could someone help me so that it alerts on the correct message.

Thanks
Matt
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_logfile help

Post by scottwilkerson »

you may need to escape the [] and add them back in there, like

Code: Select all

criticalpatterns => ['\[ERR-04704\] No inspection step found']
or possibly with double quotes

Code: Select all

criticalpatterns => ["\[ERR-04704\] No inspection step found"]
I'm not 100% sure as we are not the developers of this plugin
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
MattSmith46
Posts: 4
Joined: Tue Dec 19, 2017 4:38 pm

Re: Check_logfile help

Post by MattSmith46 »

Thank you Scott this is the one that worked.

Code: Select all

criticalpatterns => ['\[ERR-04704\] No inspection step found']
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_logfile help

Post by scottwilkerson »

MattSmith46 wrote:Thank you Scott this is the one that worked.

Code: Select all

criticalpatterns => ['\[ERR-04704\] No inspection step found']
Excellent! Glad it is resolved!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked