NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gogginl
Posts: 5
Joined: Mon Apr 07, 2014 8:41 am

NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE

Post by gogginl »

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!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE

Post by lmiltchev »

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!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE

Post by rajasegar »

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!
This uses the external check_logfiles which is the best log file scanner.
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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: NSCLIENT++ CHECK_LOGFILES NEED EXAMPLE

Post by hsmith »

Thank you @rajasegar. Appreciate the post.

@gogginl, did this work out for you?
Former Nagios Employee.
me.
Locked