Page 2 of 2

Re: How to check warn and critical errors in log file

Posted: Thu Apr 13, 2017 4:25 pm
by mcapra
satishvjadhav wrote:in arg1 i will specify that plugin name
That is actually incorrect if you look at the syntax associated with the check_nrpe command. As a reminder, commands != plugins. Commands are something you define in Nagios XI that get assigned to a host/service check. A command can leverage a plugin, but the two are completely separate things.

The -c argument for check_nrpe refers to a command definition in your remote machine's NRPE configuration file. Something like this:

Code: Select all

command[check_peanut_butter]=/path/to/plugin/check_sandwich $ARG1$
Which, if I wanted to call using check_nrpe, might look like this:

Code: Select all

/usr/local/nagios/etc/check_nrpe -H 192.168.0.0 -c check_peanut_butter -a '--condiment pb --warning 2 --critical 3'
Which would translate into a service in the Core Config Manager that might look like this:
2017_04_13_16_24_21_CCM_Nagios_XI.png

Re: How to check warn and critical errors in log file

Posted: Fri Apr 14, 2017 4:37 am
by satishvjadhav
confused bit.

Ok you to mean to say If I wanted to check warning/critical errors I can go ahead below:

/usr/local/nagios/etc/check_nrpe -H 192.168.0.0 -c check_log -a '--condiment pb --warning 2 --critical 3'

Re: How to check warn and critical errors in log file

Posted: Fri Apr 14, 2017 10:49 am
by mcapra
satishvjadhav wrote: Ok you to mean to say If I wanted to check warning/critical errors I can go ahead below:

/usr/local/nagios/etc/check_nrpe -H 192.168.0.0 -c check_log -a '--condiment pb --warning 2 --critical 3'
If check_log is a command that accepts --condiment as an argument, then yes. But I suspect this is not the case. Whatever you provide with -a will need to be specific to the plugin associated with your check_log command. Some plugins use --warning and --critical, some use -w and -c, some use warning='number', some use something totally different. You'll need to know what the plugin you're feeding arguments to is looking for syntax-wise.

Re: How to check warn and critical errors in log file

Posted: Fri Apr 14, 2017 11:16 am
by satishvjadhav
Yes I know the plugin I want to use. its check_lo3.pl

/usr/local/nagios/etc/check_log3.pl -H 192.168.0.0 -l log_file -p patternfile -s seekfile -t ??? -w ??? -c ??

I am not sure abt full grammatical syntax of this command.

Thank you,
satish

Re: How to check warn and critical errors in log file

Posted: Fri Apr 14, 2017 12:20 pm
by avandemore
check_log3.pl is not a Nagios native plugin so you'll need to refer to the authors documentation to find the usage. Often plugins will accept -h as a parameter to print out builtin help.

Code: Select all

/usr/local/nagios/etc/check_log3.pl -h
Is this the plugin you are referring to?

https://exchange.nagios.org/directory/P ... pl/details

It's usage is available there or can be worked out from the source code.