How to check warn and critical errors in log file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
satishvjadhav
Posts: 16
Joined: Tue Mar 07, 2017 5:18 am

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

Post 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'
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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.
Former Nagios employee
https://www.mcapra.com/
satishvjadhav
Posts: 16
Joined: Tue Mar 07, 2017 5:18 am

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

Post 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
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

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

Post 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.
Previous Nagios employee
Locked