Page 1 of 1

Plugin to monitor error messages in a log file for windows s

Posted: Tue Feb 16, 2021 4:06 am
by tchandra
Team,

we have a task to monitor error messages in a log file for a application server.
we tried with check_log files plugin and it showing the output OK - no errors or warnings.
But user is saying that jobs failed and threw the error.when we checked the file & found error messages , but Nagios didn't checked the error pattern and still showing status as OK.
can someone please suggest on this

Command defined in custom file :

check_logfiles_AcurityCmore=scripts\check_logfiles.exe --f scripts\etc\check_logfiles.cfg --searches=AcurityCmore

Script :

$seekfilesdir = 'C:\Program Files\NSClient\scripts\var';
$protocolsdir = 'C:\Program Files\NSClient\scripts\var';

$MACROS = { LOGDIR => 'D:\AcurityCmore-JobServer\logs' };
@searches = ({
tag => 'AcurityCmore',
logfile => '$LOGDIR$\service-runner.err.txt',
criticalpatterns => ['AcurityServerDaemonException:','SQLServerException: The connection is closed.'],
options => 'nologfilenocry',
}
);


Thanks in advance.

Re: Plugin to monitor error messages in a log file for windo

Posted: Tue Feb 16, 2021 3:30 pm
by cdienger
Has this worked previously? My first thought is that the pattern isn't matching, but we would need to see an example of service-runner.err.txt to test that.

Another possibility is that it did work initially, but then subsequent checks would have not returned CRITICAL since the plugin monitors the file and will only scan new log entries on subsequent check attempts.

Re: Plugin to monitor error messages in a log file for windo

Posted: Wed Mar 17, 2021 10:09 pm
by tchandra
Hi cdienger ,

Thanks for your response.
Anyhow issue got fixed , after editing the script.
Previously, It is checking new entries only.

Regards,
Chandra

Re: Plugin to monitor error messages in a log file for windo

Posted: Thu Mar 18, 2021 4:14 pm
by cdienger
Thanks for the update!