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.
I have been trying to get the criticalthreshold option working in the check_logfiles (https://labs.consol.de/nagios/check_logfiles/) plugin to work in my setup without luck. What I am trying to do it only give a critical alert when there are 30 matches of the critical paterns on a check. Currently it alerts when there are any matches (one or more). If someone could point me at what I am configuring wrong I would really appreaciate it.
I have tried both: criticalthreshold => 30 and options => ' criticalthreshold=30'
$seekfilesdir = '/tmp/nagios';
# where the state information will be saved.
$protocolsdir = '/tmp/nagios';
# where protocols with found patterns will be stored.
$scriptpath = '/usr/local/nagios/libexec:/tmp/nagios';
# where scripts will be searched for.
@searches = (
{
tag => 'App_Log',
logfile => '/var/log/app-log.log',
criticalpatterns => ['ERROR','FATAL',],
criticalthreshold => 30
}
);
[no]savethresholdcount Controls whether the hit counter will be saved between the runs. If yes, hit numbers are added until a threshold is reached (criticalthreshold). Otherwise the run begins with resetted counters. default: on
Thanks, for the reply. I did check out their examples, but unfortunately they don't have an example for that setting.
The option that you noticed is for keeping a count between checks, I only want to get an alert if there is that many alerts within each log check period.
Thanks, for the reply. I did check out their examples, but unfortunately they don't have an example for that setting.
The option that you noticed is for keeping a count between checks, I only want to get an alert if there is that many alerts within each log check period.
I understand that part, the caveat here is that I believe the feature is turned 'on' by default, and will impact your checks - that's why I brought it up.
Judging by the docs, it looks like your configuration file has a parameter where it should instead have an option. Can you give this revision a try and see if it produces the desired results:
$seekfilesdir = '/tmp/nagios';
# where the state information will be saved.
$protocolsdir = '/tmp/nagios';
# where protocols with found patterns will be stored.
$scriptpath = '/usr/local/nagios/libexec:/tmp/nagios';
# where scripts will be searched for.
@searches = (
{
tag => 'App_Log',
logfile => '/var/log/app-log.log',
criticalpatterns => ['ERROR','FATAL',],
options => 'criticalthreshold=30'
}
);