Page 2 of 2

Re: check_log pluggin getting Service Check Timed Out

Posted: Mon Jan 08, 2018 3:41 pm
by kyang
Thanks for the help @mcapra!

bosco, let us know if you have any more questions after reading what mcapra wrote.

Re: check_log pluggin getting Service Check Timed Out

Posted: Wed Jan 10, 2018 12:02 am
by bosco
Couln't find any "seekfiles" in tmp or temp or the respetive log files folder. Could you share how to get the versions of check_log3.

Re: check_log pluggin getting Service Check Timed Out

Posted: Wed Jan 10, 2018 2:23 am
by bosco
Thanks,

Tried to find the "seekfile" in tmp,temp and respective log folder,couldnt find that file.Also could you share how to fetch version of check_log3

Re: check_log pluggin getting Service Check Timed Out

Posted: Wed Jan 10, 2018 4:23 pm
by tgriep
One more thing to try is to increase the timeout settings for NSClient++.

Edit the nsclient.ini file on the server in question and add the following option

Code: Select all

timeout = 120
Under these sections

Code: Select all

[/settings/default]
[/settings/external scripts]
Save the ini file and restart NSClient++ to load the changes.

Typically, to bet the version of a plugin, all you have to do is run the executable with --help and it should print out the help screen and version number if it was written to do so.

Re: check_log pluggin getting Service Check Timed Out

Posted: Wed Jan 10, 2018 4:44 pm
by lmiltchev
I am not very familiar with check_log3 as this is a 3rd party plugin, but I believe you could do the following:

# To specify a seek file
Use the "-s" flag. You may need to create the file first.

Example (in nsclient.ini):

Code: Select all

check_log3 = scripts\check_log3.exe -l "c:\test.log" -p "failed" -s "c:\seek"
Test from Nagios:

Code: Select all

[root@main-nagios-xi services]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log3
WARNING: Found 3 lines (limit=1/0): This is a test - failed|'lines'=3
When I open the "seek" file in a text editor, I see "71". The number updates, when "new failed" entries are added to the log.

# To check the version number of the plugin
You could use the "-v" flag.

Example (in nsclient.ini):

Code: Select all

check_log3_version = scripts\check_log3.exe -v
Test from Nagios:

Code: Select all

[root@main-nagios-xi services]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log3_version
check_log3.exe version 3.11d
# To view the options/help menu
Example (in nsclient.ini):

Code: Select all

check_log3_help = scripts\check_log3.exe
Test from Nagios:

Code: Select all

[root@main-nagios-xi services]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log3_help
Log file not specified.

This is check_log3.exe version 3.11d

Usage: check_log3.exe [ -h |'--help'=0 ']
Usage:'=0 'check_log3.exe'=0 '['=0 '-v'=0 '|'=0 '--version'=0 ']
Usage:'=0 'check_log3.exe'=0 '['=0 '-v'=0 '|'=0 '--list-encodings'=0 ']
Usage:'=0 'check_log3.exe'=0 '-l'=0 'log_file|log_directory'=0 '(-p'=0 'pattern'=0 '[-p'=0 'pattern'=0 '...])|-P'=0 'patternfile)
        [-i]'=0 '[-n'=0 'negpattern|-f'=0 'negpatternfile'=0 ']'=0 '[-s'=0 'seek_file|seek_base_dir]
        ([-m'=0 'glob-pattern]'=0 '[-t'=0 'most_recent|first_match|last_match]'=0 '[--timestamp'=0spec])
        [-d] '[-D]'=0 '[-1]'=0 '[-a]'=0 '[-C'=0 '{-|+}n]'=0 '[-q]'=0 '[-Q]'=0 '[-e'=0 ''{ eval block }'|-E'=0 'script_file]
        [--ok]|([-w'=0 'warn_count]'=0 '[-c'=0 'crit_count]'=0 '[--negate])
        [--input-enc'=0 '[--output-enc'=0 '[--crlf]
        [--missing'=0 '[--missing-msg'=0 'manual:'=0 'perldoc'=0 'check_log3.pl'=0
Hope this helps.