Hi!
I have never used this plugin and I need help with it.
I need to configure a check with check_logfiles that finds if a string is repeating N times in one minute, in a log file. If this string appears N times or more show an CRITICAL error, if not, OK.
Thanks in advance!
howto find if a string is repeating N times in one minute
howto find if a string is repeating N times in one minute
Last edited by iam33 on Wed Dec 20, 2017 7:15 am, edited 1 time in total.
Re: howto find if a string is repeating N times in one minut
You can create a config file similar to the one below, and place it in the plugins directory:
Note: Set "criticalthreshold" and "logfile" values according to your needs.
Test it from the command line:
where you substitute "yourconfig.conf" with the actual config name. Schedule the check to run every minute.
Let us know if this helped.
Code: Select all
$seekfilesdir = '/tmp';
$protocolsdir = '/tmp';
$scriptpath = '/usr/local/nagios/libexec';
@searches = (
{
tag => 'error',
criticalpatterns => [ 'error' ] ,
criticalthreshold => 5,
options => 'noprotocol,report=long,allyoucaneat',
logfile => '/tmp/error.log'
}
);
Test it from the command line:
Code: Select all
/usr/local/nagios/libexec/check_logfiles -f yourconfig.conf
Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: howto find if a string is repeating N times in one minut
It´s Works!
thank you so much!
thank you so much!
Re: howto find if a string is repeating N times in one minut
I am glad I could help!
Be sure to check out our Knowledgebase for helpful articles and solutions!