I need to use the CHECK_LOGFILES with NSCLIENT++
I have successfully installed nsclient++ on a machine with a log files I need to scan.
I tried the nscp test (loaded plugin check_logfiles) but have no idea what parameters this takes
The internet pages I found don't seem to help me.
For example I tried the following;
nscp test
load check_logfiles
check_logfiles <filename> <pattern> BUT THIS IS NOT THE CORRECT PARAMTERS!
I was thinking this was a simple tool when I started? Any help on this would be appreciated.
Also any script that can be shared to do the same would be great!
NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE
Re: NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE
Can you give us a little bit more info about how you installed check_logfiles? Did you install this plugin? Can you show us the nsclient.ini file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE
This uses the external check_logfiles which is the best log file scanner.gogginl wrote:I need to use the CHECK_LOGFILES with NSCLIENT++
I have successfully installed nsclient++ on a machine with a log files I need to scan.
I tried the nscp test (loaded plugin check_logfiles) but have no idea what parameters this takes
The internet pages I found don't seem to help me.
For example I tried the following;
nscp test
load check_logfiles
check_logfiles <filename> <pattern> BUT THIS IS NOT THE CORRECT PARAMTERS!
I was thinking this was a simple tool when I started? Any help on this would be appreciated.
Also any script that can be shared to do the same would be great!
Dump the check_logfiles.exe in c:/Program Files/NSClient++/scripts
Create directory c:/Program Files/NSClient++/config
Create directory c:/Program Files/NSClient++/log
Dump all your check_logfiles config files in c:/Program Files/NSClient++/config
For more sample config files, type check_logfiles.exe --help or refer to this website
https://labs.consol.de/nagios/check_logfiles/
myconfigfile.cfg sample
Code: Select all
$seekfilesdir = 'C:\\Program Files\\NSClient++\\log';
# where the state information will be saved.
$protocolsdir = 'C:\\Program Files\\NSClient++\\log';
# where protocols with found patterns will be stored.
$scriptpath = 'C:\\Program Files\\NSClient++\\config';
# where scripts will be searched for.
$MACROS = {LOGDIR => "D:\\XGATE\\log"};
@searches = (
{
tag => 'ChannelPOG',
logfile => '$LOGDIR$\\PogLog.log',
criticalpatterns => ['processBracGate\(3\) Exception',
'processBracGate\(6\) Exception',
'processCMTGate\(1\) Exception',
'processCMTGate\(4\) Exception',
'processKotakGate\(8\) Exception',
'processMetroGate\(7\) Exception',
'processNiagaGate\(4\) Exception'],
warningpatterns => ['##Nagios - Not Defined##'],
options => 'nocase'
}
);
Code: Select all
Ensure the following is there in nsclient.ini. I am using arguments or you can hard code the details here.
; A list of wrappped scripts (ie. using the template mechanism)
[/settings/external scripts/wrapped scripts]
check_logfiles = check_logfiles.exe $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
; A list of templates for wrapped scripts
[/settings/external scripts/wrappings]
exe = scripts\\%SCRIPT% %ARGS%Code: Select all
define service {
host_name myhost
service_description Log: ChannelPOG
use STPT-Mytemplate
check_command check_nrpe_win!check_logfiles!" -t 30"!" -f config\\myconfigfile.cfg"!!!!!
max_check_attempts 1
check_interval 5
retry_interval 1
register 1
}
Last edited by rajasegar on Thu Oct 22, 2015 6:34 pm, edited 1 time in total.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
RHEL 6 & 7
rrdcached & ramdisk optimisation
Re: NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE
Former Nagios Employee.
me.
me.